jQuery DataTables - Slow initiation, “Normal” html table shown in the beginning

后端 未结 10 1295
旧时难觅i
旧时难觅i 2021-02-03 22:01

I\'m using jQuery DataTable plugin, but I got a concern where the scripts loading seems to take some time, so my web page is always displaying the ordinary html table first, and

10条回答
  •  情书的邮戳
    2021-02-03 22:48

    I had the same problem. Try this:

    var dTable=$("#detailtable").dataTable({
            "bProcessing":true,
            "bPaginate":false,
            "sScrollY":"400px",
            "bRetrieve":true,
            "bFilter":true,
            "bJQueryUI":true,
            "bAutoWidth":false,
            "bInfo":true,
            "fnPreDrawCallback":function(){
                $("#details").hide();
                $("#loading").show();
                //alert("Pre Draw");
            },
            "fnDrawCallback":function(){
                $("#details").show();
                $("#loading").hide();
                //alert("Draw");
            },
            "fnInitComplete":function(){
                //alert("Complete");
            }
    

提交回复
热议问题