How i remove columns and recreate datatable
How i remove columns and recreate datatable

i try to remove columns by use destroy() function but not working it's does not remove old columns
example
First
columns = [id,name,point1,point2]
But when i destroy and try to recreate to
Second
columns=[id,name,point1,point2,point3,point4]
i got old columns mix with new column like this
columns = [id,name,point1,point2,point3,point4,point1,point2]
it's should be like columns=[id,name,point1,point2,point3,point4] (Second)
how i fix it?
This discussion has been closed.
Answers
I think you will need to use [jQuery empty()] on the
table
to remove the old header. Use it after you usedestroy()
then append the new header or usecolumns.title
to add the header.Kevin
You can also ColReorder - that might do the trick
Colin