Dynamic table height and grouping in tables

v8.1.28

I am trying to group data displayed in a table into collapsible sections. Since it doesn't look like the perspective table has a grouping options, I'm experimenting with the accordion container with a table in each subview. I can't figure out how to get the table height to auto-fit the number of rows of data. If I set the height to auto, it collapses in the parent view to zero height, even with three rows of data. If I choose a fixed height, then I've got a bunch of wasted space (and will still have scroll bars if more rows are added than will fit).

Is there a better way?

Have you looked at using Row subviews? I use them quite a bit, and the right settings allow the inner table to fit completely without wasted space.

Setting the Position of both the Table, and the Embedded Views Table to these settings works well for me
grow: 1
shrink: 1
basis: auto

Just be cautious with these since they can significantly impact the performance of the table and increase load times if you have as lot of rows

2 Likes

Definitely something to be aware of, but the sample shown shouldn't be an issue :laughing:

Everywhere I use this, the max rows and max subview rows are well defined by the system, so they can't grow into a performance issue.

1 Like

I've done this by setting an explicit height for rows, then binding the table's basis to a calculation based on the length of the data:


Not very elegant, but it works...

1 Like