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加载数据

posted @ 2017-10-16 21:32  -小打小闹小幸福ζ  阅读(2464)  评论(0编辑  收藏  举报