Is it posible to send each time the last id from my datatable?
Is it posible to send each time the last id from my datatable?

Hi, here is the next scenario:
1. I have a endpoint where I pull the data and send it to datatable
2. When I get the data from the endpoint I want to save the last id that I get
3. Based on that id, I send a call to that endpoint with the last id that I got and I get a new set of data.
4. So first time will be myendpoint.com/getData and the second time will be myendpoint.com/getData?last_id=10
Is it posible to do that using datatable?
This question has an accepted answers - jump to answer
Answers
Yes, its possible. Need more info to give details.
Are you using
ajax
or jQuery Ajax request for this?Depends on the answer to the previous question. But you can get if from the JSON response. You can access the JSON response and various events, like
xhr
, if usingajax
.If using
ajax
you can useajax.url().load()
to update the URL and fetch then new dataset. This will clear the table and load the new response.Kevin
Thanks for the reply, this is what I was looking for