table.rows([0,1,2,3,4], {{order: 'current'}).nodes() doesn't return top 5 rows. REPRO WITH FIDDLE
table.rows([0,1,2,3,4], {{order: 'current'}).nodes() doesn't return top 5 rows. REPRO WITH FIDDLE
ktravelet
Posts: 4Questions: 2Answers: 0
Hi All,
I'm having an issue where I'm trying to select the top 5 rows by the current sort order.
calling dataTable.rows([0,1,2,3,4], {order: 'current'}).nodes()
gets first 5 rows added instead top 5 by current sort order.
Fiddle: http://jsfiddle.net/3w92xstp/3/
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You need to use
:eq(i)
to get the elements by sort. Using an integer gets them by their data index (seerow-selector
). In this case you could actually use:lt()
jQuery selector:table.rows(':lt(5)', {order: 'current'})
.Allan
Thats a new one. Just confirmed it definitely solves my issue. Thanks for all your work!