DataTable().destroy(true); does not remove fixed footer
DataTable().destroy(true); does not remove fixed footer
Maikel
Posts: 75Questions: 18Answers: 1
in FixedHeader
Hey i have a datatable running with a fixedheader and a fixedfooter.
When i removed the whole table with DataTable().destroy(true); everything is removed except the fixed footer that was displaying at that moment.
Any solution for this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It appears to work okay here. Can you link to a test case showing the issue please?
Allan
Seems to work here:
http://live.datatables.net/vugiwuki/1/edit
Can you post a link to your page or a test case showing the issue?
Kevin
i can not post a link the problem.
what we do:
1- load a div with ajax, this div contains a dom sourced table
2- we destroy all instances of datatables
3- we start datatables on this new table, and add a fixed header/footer
4- via ajax we load a new table in the same div (with a new id)
5- we destroy all instances of datatables
6- we start datatables on this new table, and add a fixed header/footer
at this moment the footer that was displayed from the first table is still visible ...
the code used fot step2/3 and 5/6) can be viewed at
https://dev.puka.be/js/main.orig.js
function createDataTable
Can you build a test case showing the issue?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
You can find a base example using AJAX here:
https://datatables.net/manual/tech-notes/9
Kevin
here is one
http://live.datatables.net/mepobagu/9/edit
Thanks! Here is an updated example:
http://live.datatables.net/suzodedu/1/edit
I changed the order of operations in the click event. Datatables destroys the table before clearing and moving the second table's HTML to the first.
Also I added the
.tbl
class to the second table.Kevin
destroying them before we remove them from fixes the problem.
Thanks