Showing specific rows of the table

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

azaleas
Ebase User
Posts: 81
Joined: Thu Jul 30, 2015 12:44 pm

Showing specific rows of the table

#1

Postby azaleas » Wed Aug 19, 2015 12:52 pm

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

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Wed Aug 19, 2015 2:03 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:

Code: Select all

tables.TABLE2.copyTable(tables.TABLE1, true);
Then you can remove any rows you don't want from TABLE2 like this:

Code: Select all

var rows = tables.TABLE2.rows;
while (rows.next())
{
  if ......
  {
     tables.TABLE2.deleteRow();
   }
}
0 x

azaleas
Ebase User
Posts: 81
Joined: Thu Jul 30, 2015 12:44 pm

#3

Postby azaleas » Thu Aug 20, 2015 6:05 am

Yes, I'm using Table Control. I'll try to implement the solution you provided. If I use the Repeater Control, how can I achive the result?
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Thu Aug 20, 2015 7:27 am

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:

Code: Select all

var rows = tables.TABLE1.rows;
while (rows.next())
{
  if ......
  {
     controls.PANEL1.hide();
  }
}
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.
0 x

azaleas
Ebase User
Posts: 81
Joined: Thu Jul 30, 2015 12:44 pm

#5

Postby azaleas » Thu Aug 20, 2015 9:05 am

Repeater control do sounds more flexible, but how I can add the add row button similar to the one we have in Table Control?
0 x

azaleas
Ebase User
Posts: 81
Joined: Thu Jul 30, 2015 12:44 pm

#6

Postby azaleas » Thu Aug 20, 2015 10:32 am

azaleas wrote:Repeater control do sounds more flexible, but how I can add the add row button similar to the one we have in Table Control?
Never mind, I just left add row of the table:)

Thanx again for the solutions.
0 x


Who is online

Users browsing this forum: No registered users and 7 guests