Datatables warning(table id = 'example'): cannot reinitialise data table

前端 未结 13 1357
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 15:07

I am working with datatables example and getting an error like this when loading page: Datatables warning(table id = \'example\'): cannot reinitialise data table. To retriev

13条回答
  •  情话喂你
    2020-12-04 15:37

    Try adding "bDestroy": true to the options object literal, e.g.

    $('#dataTable').dataTable({
        ...
        ....
        "bDestroy": true
    });
    

    Source: iodocs.com

    or Remove the first:

    $(document).ready(function() {
        $('#example').dataTable();
    } );
    

    In your case is the best option vjk.

提交回复
热议问题