"ajax": function (data, callback, settings) is not updating new response data.

"ajax": function (data, callback, settings) is not updating new response data.

pansathishpansathish Posts: 12Questions: 2Answers: 0
edited August 2014 in Free community support

Hi Allan,

In previous datatable version I have used fnServerData(data, callback, settings) function to send post data to server. whenever I moving to next or previous page It will automatically get the data from ajax response and reload datatable with new data.

eg.

"fnServerData": function(sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "post",
"success": function(data) {
fnCallback(data);
},
"url": "testdata.php",
"data": aoData,
});
},

But In new version 1.10.2 I have converted same functionality,

"ajax": function (data, callback, settings) {
$.ajax({
"url": "testdata.php",
"type": "POST",
"data" : data,
"success":function(data){
callback(data);
}
});
}

In that, when loading firsttime it is working fine.. but when I move next page or previous page, new data is not updating with datatable .. ie. showing first page data only. when I clicking next page it getting data correctly from the server.. not updating new data with dataTable..

Please suggest any fixes,

Thanks,
Sathishbabu

Answers

This discussion has been closed.