How do I get the displayed row at the top?

Hi,  I have a widget scrollable table which contain a few different fields, when changing certain fields I need to go thru all of the rows and affect certain ones.  I’ve already figured out that the rows that are off the screen are not modifiable directly, I need to modify the table created on the side but my problem is how do I identify the rows that are showing on the screen.  I have 20 rows in my table but only show 9 on the screen so I do I find out the index of the 1st row on the screen and the index of the last row on the screen?

Thanks in advance.

Hi @g.houde,

I suppose there are various ways to do this, but one method would be to use the “getRowAtIndex()” function and loop through the total number of tableView indices. Then, as you do so, check the x/y position of that row and compare it to your content area bounds to determine if it’s “on screen” or not.

http://docs.coronalabs.com/api/type/TableViewWidget/getRowAtIndex.html

Take care,

Brent

Hi @g.houde,

I suppose there are various ways to do this, but one method would be to use the “getRowAtIndex()” function and loop through the total number of tableView indices. Then, as you do so, check the x/y position of that row and compare it to your content area bounds to determine if it’s “on screen” or not.

http://docs.coronalabs.com/api/type/TableViewWidget/getRowAtIndex.html

Take care,

Brent