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?

hanuka192hanuka192 Posts: 2Questions: 1Answers: 0

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

  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922
    Answer ✓

    Yes, its possible. Need more info to give details.

    I have a endpoint where I pull the data and send it to datatable

    Are you using ajax or jQuery Ajax request for this?

    When I get the data from the endpoint I want to save the last id that I get

    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 using ajax.

    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.

    If using ajax you can use ajax.url().load() to update the URL and fetch then new dataset. This will clear the table and load the new response.

    Kevin

  • hanuka192hanuka192 Posts: 2Questions: 1Answers: 0

    Thanks for the reply, this is what I was looking for

This discussion has been closed.