My table may contain hundreds of rows, but only 8 are visible at any time.
When the user clicks a button on the page where the table is displayed, I want to process only the rows which are visible.
How do I process only the visible rows of a table?
Moderators: Jon, Steve, Ian, Dave
-
- Moderator
- Posts: 184
- Joined: Tue Sep 11, 2007 8:58 am
-
- Moderator
- Posts: 184
- Joined: Tue Sep 11, 2007 8:58 am
This is possible, provided that there is a way of uniquely identifying a row, using one or more cells of that row. For example, there is a column called SEQ_ID, which contains a unique value for each row.
- Add a field to the form, of the same type as the key field, say CURRENT_SEQ_ID.
Add a field to the form, type integer, called CNTR.
Attach the following script to the button (assuming your table is called T1, and the unique column is called SEQ_ID):
Code: Select all
set CURRENT_SEQ_ID = T1-SEQ_ID; // Remember the SEQ_ID of the 1st visible row
set CNTR = 0;
loop at table T1
if [CURRENT_SEQ_ID = T1-SEQ_ID]
set CNTR = 1;
endif
if [CNTR > 0]
if [CNTR < 9]
// logic to process the current row
set CNTR = CNTR + 1;
else
break;
endif
endif
endloop
0 x
-
- Ebase User
- Posts: 1
- Joined: Fri Apr 11, 2008 1:30 pm
On Scroll event
OK, but is it possible to do this automatically as the user scrolls.
I have found a reference in the documentation to 'table internal events', but can't see where I can attach a script to them.
I have found a reference in the documentation to 'table internal events', but can't see where I can attach a script to them.
0 x
- Wai
- Moderator
- Posts: 165
- Joined: Wed Sep 12, 2007 9:04 am
- Location: Sandy, UK
- Contact:
From the documentation:
User requests to sort, scroll or add a row are treated as table internal events. When one of these events occurs, all data is first validated by running the appropriate field validation event scripts if any have been specified.
So, any scripts you would like to run needs to be on the table field's validation event.
User requests to sort, scroll or add a row are treated as table internal events. When one of these events occurs, all data is first validated by running the appropriate field validation event scripts if any have been specified.
So, any scripts you would like to run needs to be on the table field's validation event.
0 x
Who is online
Users browsing this forum: No registered users and 9 guests