Refreshing table when data is from javascript object
Refreshing table when data is from javascript object
Hi,
I populate the table with javascript object array. My app has an edit window (external to datatables) which modifies this javascript data.
In the past I used to refresh the table after an edit by calling initialization again. Now I can't do that because I use some other features that don't allow calling initialization after data has been added.
I did tried to call table.draw(false)
and table.draw(true)
that did nothing. The new data is not displayed.
Is there a simple method to refresh table data, beside doing what is described at http://datatables.net/tn/3 ?
Thanks a lot
This question has an accepted answers - jump to answer
Answers
Some options:
1.If you can find the row in Datatables using
row().data()
you could update it using the same API with the new data then usedraw()
.2. Use
clear()
to clear the table thenrows().add()
to had the updated JS object.3. Use the destroy option as noted in the link you provided.
Kevin
Works like a charm , thanks!