Hi,
I have a couple of nested tables within a repeater. When a nested table has no rows it should say something like 'no data available'. These tables are then used in a pdf.
The control style option 'display no. rows information text' comes close to what i want. But i don't want to show the number of rows. And the columns shouldn't be visible either. Only the table header.
I've tried to replace the tables with repeaters but i can't get the layout right. In the form it displays correctly, but when it is transformed in a pdf it messes up the tables.
Is there a solution where i can get it to work with tables?
Layout nested tables
Moderators: Jon, Steve, Ian, Dave
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
I think the simplest approach is to loop through the rows in the outer parent table and for each row check for the number of visible rows within the nested table, and then just hide/show controls as you need to e.g. you could have a hidden text control next to the table with "No data available" and only show this when there are no visible rows. Something like this..
I haven't tried this so there may well be errors in the code, but it should work in principle.
Code: Select all
var parentRows = tables.parentTable.rows;
while (parentRows.next())
{
var tableEmpty = tables.childTable.control.numVisibleRows == 0;
controls.noDataControl.setHidden(!tableEmpty );
tables.childTable.control.setHidden(tableEmpty );
}
0 x
-
- Ebase User
- Posts: 11
- Joined: Sun Oct 11, 2015 12:56 pm
Hi Jon,
Thanks for your quick response!
The getControl function of the table object is described as "Returns the first Table Control or Repeater Control on the current page that displays this table."
If i understand correctlty this means that it isn't possible to get specific table controls.
The numVisibleRows attribute is only accesible if i get the control through controls.controlname.
Thanks for your quick response!
The getControl function of the table object is described as "Returns the first Table Control or Repeater Control on the current page that displays this table."
If i understand correctlty this means that it isn't possible to get specific table controls.
The numVisibleRows attribute is only accesible if i get the control through controls.controlname.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Who is online
Users browsing this forum: No registered users and 20 guests