1

I'm using data-tables (with jQuery). I have a data-tables set that's taking up too much memory in javascript and slowing down other things.

How can I un-initialize a data-tables table and try to clear up some memory?

Alexander Kleinhans
  • 5,950
  • 10
  • 55
  • 111

2 Answers2

2

You can use destroy() method as suggested here

var table = $('#myTable').DataTable();

$('#tableDestroy').on( 'click', function () {
    table.destroy();
} );
SRK
  • 3,476
  • 1
  • 9
  • 23
1

You can use Destroy() on the datatable.

 $('#dataTable').DataTable().destroy();

If you wish to remove all datatables from DOM, this answer demonstrates how to.

IronAces
  • 1,857
  • 1
  • 27
  • 36