Reloading a DT with an array as its source
Reloading a DT with an array as its source
Hi
This page gives a number of examples of how to load/reload some ajax data but how is this achieved with a js object array? I'm setting a DT with an array and have a refresh button but can't see how to reload the Dt with the array again after the array has been modified via ajax. Thanks.
This works on 1st load of the page only and the page above states a function needs to be used if data needs reloading:
(...)
dom: 'Bfrtip',
data: arrPrLiParams,
columns: [...]
This question has an accepted answers - jump to answer
Answers
Use
clear()
to clear the table thenrows.add()
to add the rows. Oh and don't forget to chaindraw()
onto therows.add()
.Kevin
Thanks. That worked