row & colums number in a grid

Use this board to ask questions or have discussions with other Profound.js users.
danpif
New User
Posts: 12
Joined: Fri Oct 20, 2017 6:22 am
First Name: danilo
Last Name: pifferetti
Company Name: pifferetti danilo
Contact:

row & colums number in a grid

Post by danpif »

Good morning,
in a grid, is it possible to bind to program fields: number of rows, number of columns, row height?

danilo
User avatar
Megan
Profound Logic Staff Member
Posts: 90
Joined: Mon Sep 11, 2017 12:15 pm
First Name: Megan
Last Name: Bond
Company Name: Profound Logic
Phone: 5623227473
State / Province: California
Zip / Postal Code: 92692
Country: United States
Contact:

Re: row & colums number in a grid

Post 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!
~MEGAN BOND
Technical Support Specialist
support@profoundlogic.com
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: row & colums number in a grid

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests