fnGetNodes... Which is it? All rows, or current table?
fnGetNodes... Which is it? All rows, or current table?
scotty2540
Posts: 14Questions: 1Answers: 0
http://datatables.net/ref says "Get an array of the TR nodes that are used in the table's body. "
This (and other posters) have complained that it only gives them the visible rows:
http://datatables.net/forums/discussion/7454/fngetnodes-only-returning-visible-nodes/p1
Yet, I need only the visible rows. And contrary to the doc, it is giving me all rows.
If not this function, then what function returns only the rows in the visible rows of the table?
(I am using AJAX to load, and not using deferrender )
-Scott
This (and other posters) have complained that it only gives them the visible rows:
http://datatables.net/forums/discussion/7454/fngetnodes-only-returning-visible-nodes/p1
Yet, I need only the visible rows. And contrary to the doc, it is giving me all rows.
If not this function, then what function returns only the rows in the visible rows of the table?
(I am using AJAX to load, and not using deferrender )
-Scott
This discussion has been closed.
Replies
So it returns ALL ROWS containing only COLUMNS which are visible.
I found a plugin function that returns the TR nodes which are visible. Written by someone else, I found it as "fnGetVisibleTrNodes"
I fully acknowledge that the old API in 1.9- is a bit crap. That's why there is an entirely new API in 1.10 (the old one still exists for backwards compatibility), which addresses these issues.
Specifically for row nodes you want to use the `rows().nodes()` API method which is fully documented here: http://next.datatables.net/reference/api/rows().nodes() .
The `rows()` selector allows complex selector expressions to be passed in, including the option to get nodes for only the current page: `table.rows( { page: 'current' } ).nodes()` .
Allan