Intializing DataTables breaks previous ones
Intializing DataTables breaks previous ones
anyopal
Posts: 2Questions: 1Answers: 0
Link to test case: https://jsfiddle.net/qnvehfsx/
Debugger code (debug.datatables.net): https://debug.datatables.net/udorix
Error messages shown: no errors
Description of problem: previous tables break when new tables are created without throwing errors.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I am not seeing anything in the test case that shows the problem. Can you elaborate?
Try filtering in previous data tables, or searching, the functionality is broken
Looks like the problem is the way you are appending the tables to the DOM:
Looks like this process is overwriting the previous tables in the HTML thus removing the events, etc that Datatables applies. Changed your test case to write each table to its own
div
element:https://jsfiddle.net/bjgfc1oe/
This isn't dynamic so will let you work out the best way to do this based on your full solution. {Stack OVerflow](https://stackoverflow.com/) might be a good resource to learn the best way to handle the DOM the way you want.
Kevin