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>