fnDestroy should remove elements if they were created by dataTables
fnDestroy should remove elements if they were created by dataTables
![jcspray](https://secure.gravatar.com/avatar/cf4094c48ffe128be231aee5951979cf/?default=https%3A%2F%2Fvanillicon.com%2Fcf4094c48ffe128be231aee5951979cf_200.png&rating=g&size=120)
Hi,
I'm invoking dataTable with aaData and aoColumns arguments so that it populates for me (my initial markup is just [code][/code]). This works great, but when I use fnDestroy the created elements are left, so that in future calls to .dataTable I get strange errors if the columns are different (primarily if I have more columns than I used to).
It seems to me that if dataTables is able to create elements for me, it should also remove them when I call fnDestroy -- I currently just do a .html("") on my to work around it, but it would be nice if I this was all encapsulated in dataTables.
Thanks for the useful code.
I'm invoking dataTable with aaData and aoColumns arguments so that it populates for me (my initial markup is just [code][/code]). This works great, but when I use fnDestroy the created elements are left, so that in future calls to .dataTable I get strange errors if the columns are different (primarily if I have more columns than I used to).
It seems to me that if dataTables is able to create elements for me, it should also remove them when I call fnDestroy -- I currently just do a .html("") on my to work around it, but it would be nice if I this was all encapsulated in dataTables.
Thanks for the useful code.
This discussion has been closed.