Loop through filtered 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

eddparsons
Ebase User
Posts: 53
Joined: Wed Jan 02, 2013 4:23 pm
Location: Lyndhurst, Hampshire
Contact:

Loop through filtered table

#1

Postby eddparsons » Tue May 21, 2019 1:33 pm

I have a table control with a Filter expression on. How can I loop through the table and run a command for only the rows that have been filtered?

I.e. something like the below but where the row is showing rather than the table control.

var rows = tables.STREETS.getRows();
while (rows.next()) {
if (tables.STREETS.control.showing){
fields.TOTAL_PROPERTIES.value += tables.STREETS.NUMADDRESS.value;
}
}
0 x

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

Re: Loop through filtered table

#2

Postby Jon » Tue May 21, 2019 1:46 pm

I don't think the control.isShowing() method will work. You will need to add the filter criteria check as an if statement inside the table loop - replacing the line: if (tables.STREETS.control.showing).
0 x

eddparsons
Ebase User
Posts: 53
Joined: Wed Jan 02, 2013 4:23 pm
Location: Lyndhurst, Hampshire
Contact:

Re: Loop through filtered table

#3

Postby eddparsons » Tue May 21, 2019 3:00 pm

Ok thanks Jon, adding the filter to the script works.
0 x


Who is online

Users browsing this forum: No registered users and 11 guests