Transfering the order of rows to an other page

Transfering the order of rows to an other page

the_lotusthe_lotus Posts: 2Questions: 1Answers: 0

Hope I'm posting this in the right category.

I have a table that allows the user to filter and order the rows. There's also a link on each row that goes to a different page that shows the detail information of the clicked record. On the detail page, I need a Next/Previous buttons to navigate between the different rows. Since the detail page is on a separate page than the table page, I don't have the list of rows with their order. Knowing which record is the next or previous isn't easy.

I was thinking of transferring the order

DataTable().order()

or maybe transferring each individual rows id.

var tableData = $("#tableId").DataTable().data().toArray();

$("#tableId").DataTable().rows({ order: 'current' }).every(function (rowIdx, tableLoop, rowLoop) {
    // I could transfer all rowIdx
    // Or transfer all tableData[rowIdx].Id
});

Maybe there's an other way.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    No, there's no other way, so the second code block would be the way to go. You could also add search: 'applied' to only get the rows that match the current search criteria.

    Colin

  • the_lotusthe_lotus Posts: 2Questions: 1Answers: 0

    Thanks for the information and the quick reply!

Sign In or Register to comment.