1

使用 ajax 加载 DataTable 如下:

$("#getXXData").dataTable({
  "bServerSide": true,
  "sPaginationType": "bootstrap",
  "sAjaxSource": dataRequestUrl,
  "bProcessing": true,
  "bDestroy":true,
  "iDisplayLength":100,
  "aaSorting": [[ 4, "desc" ]],
  "aoColumns": [
    { "sClass": "text-center","bSortable":false,"sWidth": "5%" },
    { "sClass": "text-left","sWidth": "40%" },       
    { "sClass": "text-left","bSortable":false,"sWidth": "30%" },
    { "sClass": "text-left","bSortable":false,"sWidth": "10%" },
    { "sClass": "text-right","sWidth": "15%" }   
  ],

  "fnInitComplete": function(oSettings, json) {
    $(".tooltip-right").tooltip({placement: "top", trigger: "hover"});
    if(json.iTotalRecords == null){
      $(".dataTables_paginate").hide();
      $("#selectAllXX").attr("checked",false);
    }
  },

  "fnDrawCallback": function() {
    $(".tooltip-right").tooltip({placement: "top", trigger: "hover"});
  },

  "oLanguage": {
    "sSearch": "<strong>Search: </strong>",
    "sZeroRecords": "No XX Found",
    "sProcessing":"&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fa fa-cog fa-spin\"></i> Processing..."
  },

});

当我在加载时单击任何链接时,出现如下错误在此处输入图像描述

有什么解决办法吗?

4

0 回答 0