Cannot read TR that is on the next page (Test Case Included)
Cannot read TR that is on the next page (Test Case Included)
c55v8
Posts: 12Questions: 2Answers: 0
I am creating a Next/Previous record functionality to my DataTable, but I a having a problem reading the next TR if it's on the other page. I even had set "deferRender : false" but it doesn't seem to help.
Below is the test case showing that the next record button works up until it hits the bottom of the page.
At that point, when it tries to read the ID of the next record, it returns as "undefined". I want it to go to the next page and highlight the next record there.
This discussion has been closed.
Replies
The rows on the next page are created (with
deferRender: false
), but they are not inserted into the document. They are only inserted into the document when required.To get the next row you would need to use the DataTables API - specifically the
rows()
selector. You'll probably want to use theselector-modifier
to tell it to get the rows in the current order as well.Allan