Expand my Community achievements bar.

How to create a dynamic table (repeating) with static header?

Avatar

Former Community Member
Hello



My purpose is to create a table which should be dynamically filled at runtime depending on the number of elements in the datasource($record.list). If the list is empty, the table shouldn't be displayed at all.



I created a subform which holds a table, ticking "Repeat Subform for each data item" and I set the binding of the table elements to $record.list[*].myelement. This works fine so far.



For the table header I created a second subform with a table having exactly the same size like the other table with text fields that contain the table header texts.



My problem now is that I would like to control the display of the subform which serves as table header row depending on whether $record.list is empty or not.



What's the best way to do this? How can I have access to the datasource for a form?



Thank you very much for your help!!!



Best regards

Bettina Hepp
2 Replies

Avatar

Former Community Member
Hi,



Instead of creating the header row outside the table.



Create it inside the same table as header row.



So when you create a condition then automatically applicable for the header row also.



This is the best option.



Regards,

sasi

Avatar

Former Community Member
Hey Sasi,



sorry for the late answer. Thank you very much for your suggestion. As I am already working on a new project, I could not try this so far, but it will be very helpful when a similar task comes up.



Kind regards

Bettina