I wish to use datatables with an existing REST service that supports paging but has it's own parameters/return values (e.g. iTotalRecords is TotalRows). I can't change the server code as it'll break existing apps.
sAjaxDataProp let's you select the "aaData" field but there doesn't seem to be any equivalent for iTotalRecords etc. Also, the server is expecting the fields pageSize and page for pagination handling.
How do I go about mapping these fields?
"fnServerData": function (sSource, aoData, fnCallback) {
$.getJSON(sSource, aoData, function (json) {
alert(json.TotalRows); <----------- would be a good spot to set the values
fnCallback(json)
})
sAjaxDataProp let's you select the "aaData" field but there doesn't seem to be any equivalent for iTotalRecords etc. Also, the server is expecting the fields pageSize and page for pagination handling.
How do I go about mapping these fields?
"fnServerData": function (sSource, aoData, fnCallback) {
$.getJSON(sSource, aoData, function (json) {
alert(json.TotalRows); <----------- would be a good spot to set the values
fnCallback(json)
})