TotalRecordCount by Server
TotalRecordCount by Server
grizzmock
Posts: 1Questions: 1Answers: 0
Hi There,
i am using the datatable with server side processing and a custome ajax-function:
this.table = tableElement.DataTable({
ajax: function(data, callback, settings) {
callback({ data: getDataObjectArrayFromServer(data) });
},
...
My backend consists of some REST Webservices which handle the paging/sorting/filtering but i can't find any information how i can make the frontend paging work correctly.
The table displays:
Showing 0 to 0 of 0 entries (filtered from NaN total entries)
how can i set these information (the total number for example by an extra HTTP Call)?
Thanks a lot
Chris
This discussion has been closed.
Answers
What is contained in your getDataObjectArrayFromServer data?
Is it returning the necessary values that dataTables is seeking?
your data needs to contain the elements for
"recordsTotal", "recordsFiltered", and then the actual "data"
I tend to include this all as part of the JSON response from the server.