Problem getting double controls

Problem getting double controls

eevevensoneevevenson Posts: 4Questions: 0Answers: 0
edited December 2012 in General
Details here:

http://stackoverflow.com/questions/13984698/datatables-showing-two-seach-boxes-and-pagination-data

Replies

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin
    > $('body').html(data);

    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
  • eevevensoneevevenson Posts: 4Questions: 0Answers: 0
    Allan,

    Thanks for this insight. I'll try to incorporate this.

    Best,

    Erik
This discussion has been closed.