Get Data through Ajax on Page Change in Client Side Processing

Get Data through Ajax on Page Change in Client Side Processing

Praveen_JSPraveen_JS Posts: 2Questions: 1Answers: 0

Hello All,

I want to achieve the below and need your suggestion for the same.
* Get the Data on Page Change through Ajax with the help of Offset and populate the same.
* I am already aware about the server-side processing, but the API does not handle by us, so we can not change it.
* API has the support of offset, return 200 records in one call and also return the total number of records.

Let me know of the same is achievable or not.

Thanks in advance.

Answers

  • colincolin Posts: 9,780Questions: 0Answers: 1,619

    No, you would need to use serverSide if you want more data pulled on page change. Otherwise, DataTables would expect to have full knowledge of the data set, such as the ordering and number of records for example, without that it wouldn't know that there was additional pages.

    Colin

  • Praveen_JSPraveen_JS Posts: 2Questions: 1Answers: 0

    Hello Colin,

    Thanks for the response.

    Is there a way I can use serverSide and then format the data on the client-side, because of the data which I am getting is not formatted as per the datatable standards?

  • colincolin Posts: 9,780Questions: 0Answers: 1,619

    If you want to modify the JSON you can do that in ajax.dataSrc (there's an example doing just that on the page). If it's more subtle, you can use columns.render to change how the data is presented.

    Colin

Sign In or Register to comment.