Using colReorder with destroy()
Using colReorder with destroy()
Hi there, it's me again having problems with colReorder()
On the first load, the dynamic table is complete generated, with the colReorder, and this works fine
But then I need to generate another dynamic table with another data, and I need to use the same table ID
I call the DataTable().clear() and when I call DataTable.destroy(), it gives me an error like the one below
"Uncaught TypeError: Cannot read properties of null (reading 'dt')
at ColReorder._fnStateSave (dataTables.colReorder.js:853)"
If I don't call the destroy() method, I can't initialise another dynamic table using the same table ID...
Can someone help me please?
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hey colin, thanks for your help
I uploaded the code using debugger and the link is https://debug.datatables.net/usosem
Can you please take a look to help me ?
Thanks for the debug, but it's the test case or a link to your page that we need to progress this. This will be a flow issue, how your code is interacting at the various steps, so we need to see those steps in action,
Colin
I dont have a DNS to show you the page and I can't figure out how to create the example in the test page (I really dont know hot to make it work)
I tried all the links in the section "How to provide a test case" and my code does not seems to work
Is there another way you can help me?
Here is a simple test case demonstrating the problem. Seems to be an issue with ColReorder and StateSave.
http://live.datatables.net/saxasewa/1/edit
Kevin
For me using destroy(true) solved the problem but the bug is still there
Awesome - thanks for the test case Kevin.
The issue was fixed with this commit and the nightly carries that fix. Updated example.
We'll tag up this fix in ColReorder in the near future.
Regards,
Allan
hey guys, thanks for the reply
but I solved this using jquery.remove("div") and then creating the
<
table> with javascript and applying the .DataTable()