表主体未在服务器端处理数据表中加载

时间:2014-04-30 05:42:35

标签: javascript jquery ajax grails server-side

我从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函数中没有看到警报,请帮助

1 个答案:

答案 0 :(得分:0)

现在完成了我在ajax函数中错过了"success":fncallback