Is that possible to invoke a javascript function in success of datatable ajax call. Here is the code am trying to use,
var oTable = $('#app-config').dataTable(
{
"bAutoWidth": false,
"bDestroy":true,
"bProcessing" : true,
"bServerSide" : true,
"sPaginationType" : "full_numbers",
"sAjaxSource" : url,
"fnServerData" : function(sSource, aoData, fnCallback) {
alert("sSource"+ sSource);
alert("aoData"+ aoData);
$.ajax({
"dataType" : 'json',
"type" : "GET",
"url" : sSource,
"data" : aoData,
"success" : fnCallback
});
}
is it possible to have something like,
success : function(){
//.....code goes here
}
instead of "success" : fnCallback ------> which is last line of AJAX call. In this function I would like to check a value send from server side. Thanks in advance for any help....
You can use dataSrc :
Here is a typical example of datatables.net
Based on the docs,
xhr
Ajax event would fire when an Ajax request is completed. So you can do something like this:For datatables 1.10.12.