DataTables warning: table id=table - Cannot reinitialise DataTable. For more information about this error,

I have gone trough following error number of time when I'm using Jquery Data table.

DataTables warning: table id=table - Cannot reinitialise DataTable. For more information about this error, 



I have a combo box in the page which lead re bind the Jquary Datatable ,while  table is already bind with data.

Flowing solutions are possible to resolve the issue.

  1. Destroy the table before re bind it . $("#table").dataTable().fnDestroy();
  2.  If condition 
                                  if ( $.fn.dataTable.isDataTable('#table') ) {
table = $('#table').DataTable();
}
else {
table = $('#table').DataTable( {
} );

Comments

Popular posts from this blog

ENOENT: no such file or directory, rename : node_modules/async

react-quill Integrate quill-image-resize-module