我从json获得的结果显示在服务器端的表中:
[iTotalDisplayRecords:1, iTotalRecords:1, aaData:[[Mobile Number:98376437, Telephone Number:232323, ], sEcho:1]
将数据加载到表中的功能是:
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)
}
但是表格主体未加载,并且fnDrawCallback
函数中没有看到警报,请帮助
答案 0 :(得分:0)
现在完成了我在ajax函数中错过了"success":fncallback