I have datatable and table have ID example.
Now I need to destroy datatable and I write:
$('#example').dataTable().fnDestroy();
but I get:
Uncaught TypeError: Cannot read property 'style' of undefined
also this I get in console log:
What is the problem here? Why can't I destroy the datatable? How to solve this?
For latest version of datatables use:
$('#example').DataTable().destroy();
Refer to this for more: https://datatables.net/reference/api/destroy%28%29
For older versions use as stated by Hobo Sapiens:
$('#example').DataTable().fnDestroy();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With