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