Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82031

Best way to handle ajax changing/adding rows?

$
0
0

Hi all,
My tables are made in PHP and returned via Ajax. However, I also add or replace rows without necessarily reloading the whole table from the server. When this happens, DataTable sorting can cause rows that were updated to revert to their previous state, though the underlying database of which the table is a reflection is, of course, not affected. I'm guessing this is simply because DT doesn't know about the changes in the DOM.

My question is pretty simple. What's the best way to give DT the latest update to the table, short of calling ".dataTable" on the table again? Or is that the solution? It seems to me, an inexperienced web developer making small, internal-use-only pages, that there'd be a different way. But I don't know. Performance isn't a problem, but I wonder if doing this would cause the user's position to change. Any ideas? Thanks.


Viewing all articles
Browse latest Browse all 82031

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>