refresh javascript sourced data
refresh javascript sourced data
distrirecargas
Posts: 1Questions: 1Answers: 0
Hi, If a table is initialized with Javascript sourced data and want to refresh table with new Javascript sourced data ? How we do it ? in data-tables version 1.10
This discussion has been closed.
Answers
Well since its a local javascript source, you cant just change it and update the table, that would work if you used
ajax
(which I would prefer, then you can just useajax.load()
Since you're using just local JS, you would have to clear the whole table via
clear()
, then add all the rows viarows.add()
, then of course you'd have todraw()
it after that.http://live.datatables.net/vunuqipe/1/edit?js,output
This does require you to keep the columns the same though, if you plan on changing the columns, then you should just specify the
destroy
option when you first initialize the DT instance, then re-initialize the entire table the 2nd timeGoodluck