In DT 1.9, fnServerData could return data.iTotalRecords, but in DT 1.10, ajax.dataSrc cannot?
In DT 1.9, fnServerData could return data.iTotalRecords, but in DT 1.10, ajax.dataSrc cannot?
I want to be able to control what a DataTable thinks the data.iTotalRecords (1.9) / recordsTotal (1.10) is.
In 1.9, it was possible to specify in options a fnServerData, a function which could return this value (along with the actual row data).
In 1.10, when setting option ajax.dataSrc to a function, it appears that function can /only/ return an array of data, not an object containing data and paging metadata.
Without modifying the format the server actually returns, how can I return or set paging metadata in 1.10?
Answers
Ok, so fnServerData's equivalent in 1.10 is to make ajax /itself/ a function, e.g.:
$('#someid').DataTable({
"serverSide" : true,
With this, you'll need to manage the whole ajax call yourself, but you can return the metadata,
This is correct - thanks for posting your solution.
Allan