Static row index?
Static row index?
Artuvazro
Posts: 11Questions: 5Answers: 0
Hi!
Is there any way of getting a static row index in the api? I've tried with both indexes() and nodes() but the values change according to what you're currently seeing in the table. I'm interested in getting the static index value of a row as it is written in the document containing the data of the table, and not an index number as it is displayed in the page.
Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The
row().index()
method does give the static row index - the data index for the row as held by DataTables.Do you want the index of the row in the currently applied order and page? You could use jQuery's
index()
method for that:$( table.row( ... ).node() ).index()
.Allan
Thanks, I needed this for another problem I've posted here. But I finally solved it by destroying and creating the table again.
http://datatables.net/forums/discussion/25590/rows-are-selected-differently-on-document-load-and-on-function-call#latest