2014-04-22 63 views
0

如果運行下面的代碼,而這條線:添加sPagination到我的jQuery的數據表腳本導致其停止工作

"sPaginationType": "RequestID", 

代碼的作品,但在添加該行是,我們遇到了以下錯誤:

類型錯誤:DataTable.ext.oPagination [oSettings.sPaginationType]未定義

我確實有在網頁的頂部定義的分頁程序庫:

<script type="text/javascript" language="javascript" src="js/dataTables.jPaginator.js"></script> 

我還缺少什麼?

<script type="text/javascript"> 
$(document).ready(function() { 
    /* Init DataTables */ 
$("#examples").dataTable({ 
    "bProcessing" : true, 
    "sPaginationType": "RequestID", 
    // Commenting out next line 
    //"sDom" : 't', 
    "sAjaxSource" : "phpservices/getUserDetails.php?loginName=" + UserName, 
    "sAjaxDataProp" : "", 
    "bDestroy" : true, 
    "fnServerData" : function(sSource, aoData, fnCallback) { 
     request = $.ajax({ 
      "dataType" : "json", 
      "type" : "GET", 
      "url" : sSource, 
      "data" : aoData, 
      "success" : fnCallback 
     }); 
    }, 
     "aoColumns" : [ 
      { mDataProp: "RequestID", bSortable: true }, 
      { mDataProp: "RequestDate", bSortable: true }, 
      { mDataProp: "RequestorFullName", bSortable: true }, 
      { mDataProp: "PrimarySiteContactDisplay", bSortable: true }, 
      { mDataProp: "RequestLocation", bSortable: true }, 
      { mDataProp: "RequestDescription", bSortable: true }, 
      { mDataProp: "RequestStatus", bSortable: true }, 
     ], 
     }) 
    }); 
</script> 

回答

0

我已經解決了這個問題。

我忽略將標記更改爲bPagination,與const定義一致。

"sbPaginationType": "RequestID", 

"bPaginationType": "RequestID", 
相關問題