How to set the start value in DataTable after a request?
How to set the start value in DataTable after a request?
Description of problem:
I have a DataTable setup, but the value of the start parameter used for pagination follows specific business rules, so it doesn't increment sequentially with each page. Instead, I need to receive this start value from the server response after each request and use it in the subsequent requests for pagination.
How can I dynamically set the start value in the DataTable based on the server response, and ensure that this updated start value is sent correctly in the next AJAX request?
Answers
Use the
page()
andpage.len()
methods together. There isn't an API to say "start at record X", you need to say "show page Y, where each page is Z records long".Allan