fnServerData doesn't load data
fnServerData doesn't load data
Hello,
I have a webpage where I create a datatable. The code to create the datatable is:
$('#table_id').dataTable({
"bJQueryUI": true,
"bFilter": false,
"aaSorting": [[1,'desc'],[2,'desc']],
"sPaginationType": "full_numbers",
"bdestroy": true,
"oLanguage": { "sEmptyTable": "No Events Registered"},
"sAjaxSource" : "/application/SeeEvents.do",
"bProcessing" : true,
"bServerSide" : true,
"fnServerData" : function(sSource, aData, fnCallback){
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aData,
async: false,
"success": function(data){
if(data==null )
alert("It produced an error while the application was getting the latest events");
else
if(jQuery.isEmptyObject(data))
alert("There isn't any row");
else{
fnCallBack(data);
}
}
});
},
"fnDrawCallback": function() {
format();
},
"fnInitComplete": function(){
putEventOnClick();
}
});
Any data are loaded on the table (the function fnCallBack doesn't work)
Regards
I have a webpage where I create a datatable. The code to create the datatable is:
$('#table_id').dataTable({
"bJQueryUI": true,
"bFilter": false,
"aaSorting": [[1,'desc'],[2,'desc']],
"sPaginationType": "full_numbers",
"bdestroy": true,
"oLanguage": { "sEmptyTable": "No Events Registered"},
"sAjaxSource" : "/application/SeeEvents.do",
"bProcessing" : true,
"bServerSide" : true,
"fnServerData" : function(sSource, aData, fnCallback){
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aData,
async: false,
"success": function(data){
if(data==null )
alert("It produced an error while the application was getting the latest events");
else
if(jQuery.isEmptyObject(data))
alert("There isn't any row");
else{
fnCallBack(data);
}
}
});
},
"fnDrawCallback": function() {
format();
},
"fnInitComplete": function(){
putEventOnClick();
}
});
Any data are loaded on the table (the function fnCallBack doesn't work)
Regards
This discussion has been closed.