Refreshing data - using DOM, not Ajax source
Refreshing data - using DOM, not Ajax source
redandwhite
Posts: 5Questions: 0Answers: 0
I've dug through the forum and tried out lots of suggestions, but I can't seem to find anything that exactly matches up with the problem I'm having.
I have a table that's being rendered straight into the page, and am then applying the DataTables stuff over the top. Everything works great until I need to reload the the data. I've tried a whole ton of different ways to get it to work, and each time there's some minor problem getting in the way (hidden columns re-appearing, filters being reset, extra copies of the header and footer wrapping the table, empty copies of the table left above the filled table, etc).
Rather than try to fix one particular option, can someone please just let me know the correct way to do this? I have a table that I need to fill initially, then at some point when I user clicks a button I want to make an Ajax call to the server which will return new HTML for just the table. Without DataTables I just do a .replace() on the table with the new HTML, but that doesn't seem to work here. How can I get it to completely replace my old table with the new one?
I have a table that's being rendered straight into the page, and am then applying the DataTables stuff over the top. Everything works great until I need to reload the the data. I've tried a whole ton of different ways to get it to work, and each time there's some minor problem getting in the way (hidden columns re-appearing, filters being reset, extra copies of the header and footer wrapping the table, empty copies of the table left above the filled table, etc).
Rather than try to fix one particular option, can someone please just let me know the correct way to do this? I have a table that I need to fill initially, then at some point when I user clicks a button I want to make an Ajax call to the server which will return new HTML for just the table. Without DataTables I just do a .replace() on the table with the new HTML, but that doesn't seem to work here. How can I get it to completely replace my old table with the new one?
This discussion has been closed.