REST Service and HTTP headers
REST Service and HTTP headers
Hi, let say i have a REST service that return a [{....}] and that the collection count is in the Http header X-Collection-Count ... i'm unable to use the response header instead of the of iTotalRecords and iTotalDisplayRecords for pagination purpose.
It is impossible to use
dataSrc: function(data) {
}
Since headers are not available. I would have been able to change data and add iTotalRecords and iTotalDisplayRecords comming from Http header instead.
Using tatables.js version 10.10.10 and serverSide:true
Temporary i had to change line 2772 and 2773 of jquery.dataTables.js for
var recordsTotal = settings.jqXHR.getResponseHeader("X-Collection-Count");
var recordsFiltered = settings.jqXHR.getResponseHeader("X-Collection-Count");
Thanks
Answers
xhr
will provide access to the Ajax request.Allan
so this will be available next release ?
Thanks for the quick response
Its in the current release. That event has been present since 1.10.0.
Allan