DataTable.destroy does not remove checkbox from table header
DataTable.destroy does not remove checkbox from table header
Hi,
I've recently upgraded to DataTables v2 and appreciate the improved checkboxes feature on the Select plugin. One thing I noticed though - if I call destroy()
on my DataTable, the header <input>
field remains and I have to remove it manually like this:
$('#main-table > thead > tr > th > input').remove();
Not a big problem, but I would have expected the HTML to be reset to the original state, per the documentation.
-David.
Replies
The same happens with the checkboxes in the rows too (in this example). Arguably, both should be reset.
Colin
Thanks for flagging this up. I've committed a fix to address this issue and it will be in the next Select release.
It is also a good point that Colin makes. On destroy I don't currently "derender" cells - the data is left in its rendered state, so it isn't just checkboxes, but dates and numbers have this artifact as well. Possibly it should be reverted, but I suspect that might add a large amount of code for something that has never come up before! I'll have a think about it.
Allan
Great, thanks for the quick response!