【问题标题】:table body not being loaded in server side processing datatable表体未加载到服务器端处理数据表中
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-06
      • 2016-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多