Problem getting double controls
Problem getting double controls
eevevenson
Posts: 4Questions: 0Answers: 0
Details here:
http://stackoverflow.com/questions/13984698/datatables-showing-two-seach-boxes-and-pagination-data
http://stackoverflow.com/questions/13984698/datatables-showing-two-seach-boxes-and-pagination-data
This discussion has been closed.
Replies
You are rewriting the entire HTML body's tree - so when you call `$('#emails').dataTable()` DataTables will check to see if there is already a table on that node (note it is a node check, not an ID check), but there isn't since you've destroyed it and rewritten it. So the original HTML is still present from the old table, and DataTables adds a new table, since it is a new HTML table element.
So you need to either destroy the table before rewriting the whole tree, or preferably not rewrite the whole tree, just manipulate the bits you want updated.
Allan
Thanks for this insight. I'll try to incorporate this.
Best,
Erik