User Select rows in 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

Kaprice
Ebase User
Posts: 12
Joined: Sat Apr 04, 2015 3:43 pm
Contact:

User Select rows in table?

#1

Postby Kaprice » Sat Jul 25, 2015 9:44 pm

How do I allow the user to select rows in a displayed table so I can process just those rows?

It seems I would add a logical field to the database resource. I can see how to add a calculated field, but I don't see how to make one where the User can hit a checkbox and then via a script I can identify the checked ones.

EDIT: Here's the solution I came up with (from another answer on the forum)...

I added a booleon field to the table (not the resource).

Placed that field at the left column of my table and at that point, it works as if it was part of the recordset.

I can see if it's checked once I'm pointing to a row with:

tables.GRADES.ISROWSELECTED.value



I also added a SelectAll checkbox at the above the table and put this code:

var rows = tables.GRADES.rows;

while (rows.next())
{
tables.GRADES.ISROWSELECTED.value = fields.SELECTALL.value;
}
0 x
Kap

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#2

Postby Segi » Mon Jul 27, 2015 3:07 pm

The table has a Select Column property. Click on the table in designer and on the right hand side under Table Control there's the property Show select column. This will automatically add a checkbox next to each row. In the event, you could then loop through all rows and determine which ones are selected like this:

Code: Select all

var allRows=tables.MYTABLE;
var rows=allRows.getRows();

while (allRows.next()) {
     if (allRows.isRowSelected()==true) {
           // do something here if the row is selected
    }
}
0 x


Who is online

Users browsing this forum: No registered users and 14 guests