Set datatable.data()
Set datatable.data()
CronosS
Posts: 2Questions: 2Answers: 0
Hi,
What would be the best way to get & set the data of the whole table?
I'm looking for something like this, and wish that could be possible:
//set the initial datatable
var table = $('#example').DataTable();
//add some rows
table.rows.add([...])
//store the whole data for later use
var oldData = table.data();
//add some more rows
table.rows.add([...]);
//and here is what I'm looking for, restore the whole data to a previous state
table.data(oldData);
This discussion has been closed.
Answers
I use the below two lines of code to wipe my table and load it with new data.