DataTables warning: table id=example - Cannot reinitialise


下面是我的代碼,被DataTables warning: table id=example - Cannot reinitialise 困擾半天

$(document).ready(function () {
      
        var table = $('#example').DataTable({
            //ajax 傳參
            "ajax": "@Url.Action("GetAdmin","Admin")",

            "columnDefs": [{
                //把要標簽添加到指定的列
                "targets": 5,
                "data": null,
                "defaultContent": "<button class='btn btn-info' href='#'><i class='halflings-icon white edit'></i></button>  <button class='btn btn-danger' href='#'><i class='halflings-icon white trash'></i> </button>"
            }],
           
        });

});

在網上搜尋了許久,也不知道是否對同樣困擾的你有幫助:

Datatables.ajax.url(url).load(); //從新設置的數據源URL加載數據


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM