Showing specific rows of the table
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 81
- Joined: Thu Jul 30, 2015 12:44 pm
Showing specific rows of the table
How to show only specific rows of the table? This table is used to add data to the DB. But I also want to use it to show the inserted data when required, but not all the rows.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
If you're displaying your table in a Table Control, there is no ability to hide/show rows - this is something we will add in the future, but it's missing at the moment. If you display your table in a Repeater Control (a more flexible layout), then you can hide rows.
But I'm guessing you are using a Table Control. The best way to solve this is to have two tables - one containing all your data (TABLE1 in example below) ,and one containing only the rows you want to display (TABLE2). Assuming that the columns are the same in both tables, you can copy all rows from TABLE1 to TABLE2 like this:
Then you can remove any rows you don't want from TABLE2 like this:
But I'm guessing you are using a Table Control. The best way to solve this is to have two tables - one containing all your data (TABLE1 in example below) ,and one containing only the rows you want to display (TABLE2). Assuming that the columns are the same in both tables, you can copy all rows from TABLE1 to TABLE2 like this:
Code: Select all
tables.TABLE2.copyTable(tables.TABLE1, true);
Code: Select all
var rows = tables.TABLE2.rows;
while (rows.next())
{
if ......
{
tables.TABLE2.deleteRow();
}
}
0 x
-
- Ebase User
- Posts: 81
- Joined: Thu Jul 30, 2015 12:44 pm
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
A Repeater Control provides an alternative way of displaying a table e.g. you might have a multi-line display for each row. If each row inside the Repeater is contained inside a Panel Control called PANEL1, you could then hide certain rows like this:
As an alternative, it might also be possible to stop certain rows being displayed, with either a Table Control or a Repeater Control, using a Filter expression. You will see this as a property of both these controls. The table output is filtered against this expression each time it is displayed. This is a fairly crude mechanism so might not meet your requirements.
Code: Select all
var rows = tables.TABLE1.rows;
while (rows.next())
{
if ......
{
controls.PANEL1.hide();
}
}
0 x
-
- Ebase User
- Posts: 81
- Joined: Thu Jul 30, 2015 12:44 pm
-
- Ebase User
- Posts: 81
- Joined: Thu Jul 30, 2015 12:44 pm
Who is online
Users browsing this forum: No registered users and 13 guests