How can I set the page determined by the server?

How can I set the page determined by the server?

GianniDPCGianniDPC Posts: 3Questions: 3Answers: 0

Is it possible to pass the page to the client coming from the server using Server Side datatables?

We have some sort of implementation that when a user comes back from and edit that it keeps track on which page the product is. So by using the product id I get the correct page from the server and I should be able to navigate to that page using dataTables. (Keeping in mind that the page that the product is one could be changed meanwhile) Is that possible in any way?

So to keep it simple it should be somehow possible to tell dataTables, I have 25 rows and they are on page 3 for example.

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    No, that's not possible, I'm afraid. You'll need to pass that ID to the serverSide scripts, using option ajax.data, and then get the server-side script to find the appropriate page (while also considering the filtering and ordering too).

    Colin

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    That said, if you weren't using serverSide, you could use page.jumpToData(), see here. How many records are you expecting to have in the table?

    Colin

This discussion has been closed.