How to destroy a datatable?

后端 未结 8 1628
萌比男神i
萌比男神i 2021-02-01 05:19

I\'m using datatables and using bootstrap-daterangepicker to select a range for which data will be shown in Datatables.

It is working fine.

The problem is when I

相关标签:
8条回答
  • 2021-02-01 06:12

    For DataTables 1.10, the calls are:

    // Destroy dataTable
    $('#feedback-datatable').DataTable.destroy();
    
    // Remove DOM elements
    $('#feedback-datatable').empty();
    
    0 讨论(0)
  • 2021-02-01 06:16

    To completely delete and remove the datatable object with its DOM elements you need to :

    //Delete the datable object first
    if(oTable != null)oTable.fnDestroy();
    //Remove all the DOM elements
    $('#feedback-datatable').empty();
    
    0 讨论(0)
提交回复
热议问题