Cannot read TR that is on the next page (Test Case Included)

Cannot read TR that is on the next page (Test Case Included)

c55v8c55v8 Posts: 12Questions: 2Answers: 0
edited October 2016 in Free community support

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.

http://live.datatables.net/penidimu/2/edit

Replies

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin

    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 the selector-modifier to tell it to get the rows in the current order as well.

    Allan

This discussion has been closed.