Its done now i have missed "success":fncallback
in ajax function
table body not being loaded in server side processing datatable
-
12-07-2023 - |
Pergunta
Results that i got from json to display in table by server side is as:
[iTotalDisplayRecords:1, iTotalRecords:1, aaData:[[Mobile Number:98376437, Telephone Number:232323, ], sEcho:1]
and function to load data into table is:
studentListTable = $("#serverSideTableStdList").dataTable({
"bDeferRender": true,
"bProcessing": true,
sAjaxSource:'<g:createLink url="[action:'loadTableDataForServerSide',controller:'student']" />',
"aoColumns":[
{"mData": "TelephoneNumber", "bVisible": true},
{"mData": "MobileNumber", "bVisible": true}
] ,
"oLanguage": {
"sEmptyTable": "",
"sSearch": "Search all columns:",
"sProcessing": "test"
},
bServerSide: true,
sServerMethod: "POST",
"aLengthMenu": [
[10, 50, 1000, 5000, -1],
[10, 50, 1000, 5000, 10000]
],
"iDisplayLength":10,
"fnServerData":function(sSource, aoData, fnCallback){
aoData.push( { "name": "unit", "value": unit } );
aoData.push( { "name": "shift", "value": shift } );
aoData.push( { "name": "batch", "value": batch } );
aoData.push( { "name": "stdName", "value": name } );
$.ajax( {
"dataType": 'json',
"url": sSource,
"data": aoData
} );
},
"fnDrawCallback": function(){
alert(111)
}
but the table body is not loaded and alert is not seen done in fnDrawCallback
function please help
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow