1

Using ajax to load a DataTable as follows:

$("#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..."
  },

});

When I click any link when it's loading I get an error as followsenter image description here

Any solutions?

Leandro Carracedo
  • 7,233
  • 2
  • 44
  • 50
some_other_guy
  • 3,364
  • 4
  • 37
  • 55
  • Check the procedure here: http://datatables.net/manual/tech-notes/7 – Leandro Carracedo Feb 03 '15 at 14:26
  • 1
    i faced this problem a few months back, couldn't find a fix for it, so what i did was use the blockUI plugin to disable all the page until the table finish load. of course this doesn't make sense at all since im making a async task work like a sync one, but this solution was still better then let it free couse aparently the user loves the ideia to press on a link before the table finish. im upvoting your question couse i need a solution for this too – kabstergo Feb 03 '15 at 21:08

0 Answers0