Identify Row on Current Page
Identify Row on Current Page
shmoeaz
Posts: 2Questions: 1Answers: 0
I have an external action that requires me to loop through all the rows in my table and inspect the data. However, I also want to manipulate the rows that are currently visible or displayed on the current page.
Is there a way to test the row to see if it is currently visible/on the current page?
table.rows().every(function(idx, tLoop, rLoop){
var data = this.data();
// ... do something
if (this.isOnCurrentPage()) {
// ... do somehting more
}
});
isOnCurrentPage() is just an example of what I'm trying to do. I don't know if I could use a selector some how or something of the like.
Any ideas?
Thanks
This discussion has been closed.
Answers
You can use a separate
rows().every()
loop just for the rows on the page using theselector-modifier
of {page: 'current'}, for example:You can remove the if statement from the other loop.
Kevin
I think I found an appropriate solution using the page info and the rowLoop index.
Clever solution
Kevin