【发布时间】:2014-04-30 05:42:35
【问题描述】:
我从 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函数中看不到警报,请帮忙
【问题讨论】:
标签: javascript jquery ajax grails server-side