Page 1 of 1
row & colums number in a grid
Posted: Thu Mar 08, 2018 8:24 pm
by danpif
Good morning,
in a grid, is it possible to bind to program fields: number of rows, number of columns, row height?
danilo
Re: row & colums number in a grid
Posted: Thu Mar 08, 2018 10:24 pm
by Megan
Hello Danilo,
Thank you for writing in! It is not currently possible to bind those properties directly. You may be able to use hidden fields that are bound and use the onload event to set the grid attributes and redraw the grid to your specifications.
Some APIs that may help you:
setNumberOfRows(rows):
http://www.profoundlogic.com/docs/pages ... Id=4849902
You can use setNumberOfRows(rows) to change the number of visible rows.
removeColumn(index):
http://www.profoundlogic.com/docs/pages ... Id=6127622
You can use removeColumn() to delete an unwanted column.
setProperty(property, value):
http://www.profoundlogic.com/docs/pages ... Id=4849915
You can use setProperty() to change the property values of a grid.
render():
http://www.profoundlogic.com/docs/pages ... Id=9076747
This is required to apply property changes.
If you would like to submit a feature request that these values be bindable, we could certainly create that feature request for you!
We hope this helps! If you have any questions or concerns, please let us know!
Re: row & colums number in a grid
Posted: Fri Mar 09, 2018 1:18 am
by Scott Klement
Number of rows and number of columns would be extremely difficult to make bindable.
The problem is that when a field is bound, the Visual Designer does not know what it's value will be. Bound field values are not known until runtime when the back-end program (Node.js, RPG, etc) populates the variable and writes the display format. So the entire time you are displaying your grid in the Visual Designer, these values would not be known.
This causes a big problem, because the Visual Designer needs to know how many rows/columns to display on the screen so that you can edit the grid, populate values and make other changes in the design interface. If there was no established number of rows or columns, or a way to set them in the designer, you would not be able to make changes to your grid.
Please consider using the JavaScript methods that Megan suggested instead of binding these properties. That should work nicely for your situation.