Cannot reinitialise JQuery DataTable
- Article
- Comment
Cannot reinitialise JQuery DataTable . DataTables warning: table id={id} – Cannot reinitialise DataTable. This is a common error sometimes we couldn’t solve it. There is some reason behind it for the warning. The error occurs when we pass it directly.
$('#example').dataTable( { paging: false } ); $('#example').dataTable( { searching: false } );
For some cases it will help you to solve it.
$('#example').dataTable( { paging: false, searching: false } );
Otherwise, you can destory it and create once again by the following example.
$('#example').DataTable( { destroy: true, searching: false } );
This is the easier way to solve it.
destroy: true,