How to retrieve the data currently visible on the table
How to retrieve the data currently visible on the table
stevel
Posts: 8Questions: 0Answers: 0
I have a table with 50 rows, and I've chosen the option "Show 10 entries", so only the first 10 records are visible. I haven't applied a filter.
How can I obtain a reference to the 10 currently-visible rows of data (and renew this reference when the user scrolls to the next/previous 10 rows)?
http://www.datatables.net/forums/discussion/10321/fngetdata-of-visible-rows-only/p1 says to use:
[code]var data = oTable._('tr', {"filter":"applied"});[/code]
but this is still showing me all 50 rows. Do I need to use the other suggestion of traversing the nodes:
[code]
var anNodes = $("#example tbody tr");
for (var i = 0; i < anNodes.length; ++i) .....
[/code]
Thanks,
Steve
How can I obtain a reference to the 10 currently-visible rows of data (and renew this reference when the user scrolls to the next/previous 10 rows)?
http://www.datatables.net/forums/discussion/10321/fngetdata-of-visible-rows-only/p1 says to use:
[code]var data = oTable._('tr', {"filter":"applied"});[/code]
but this is still showing me all 50 rows. Do I need to use the other suggestion of traversing the nodes:
[code]
var anNodes = $("#example tbody tr");
for (var i = 0; i < anNodes.length; ++i) .....
[/code]
Thanks,
Steve
This discussion has been closed.
Replies
[code]
var data = oTable._('tr', {"page":"current"});
[/code]
Allan