Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am getting this error when trying to reinitialise datatable: "Warning: Cannot reinitialise DataTable"

What I have tried:

I have this code:
JavaScript
var datatable = $("#datatable").DataTable();//get dt

    datatable.destroy(); //destroy old instance

    datatable = $("#datatable").DataTable({
            "scrollY": "150px",
            "paging": false
        }); // here is throwing the error: "Warning: Cannot reinitialise DataTable"
Posted
Comments
Kornfeld Eliyahu Peter 12-Jul-18 7:43am    
It seems to be all right, but try this:
datatable = $("#datatable").DataTable({
  "destroy": true,
  "scrollY": "150px",
  "paging": false
});
Member 13892308 12-Jul-18 7:57am    
I've solved the problem by changing the 1st initialization with those settings

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900