Programatically update a cell - value is lost
Programatically update a cell - value is lost
Hi,
starting from this example, I try to update a cell using, for instance:
$('#example').DataTable().cell({ row: 2, column: 2 }).data("test2").draw(false);
This will change the value in the table, but as soon as I reload the page the value is lost (i.e., is replaced with the "old" value"). I tried with draw(), draw(true) and draw(false) but nothing changes.
How can I update a cell?
Thank you!
This question has an accepted answers - jump to answer
Answers
If you are using the Editor then you will want to use the
edit()
API to edit the data and have the Editor save to the Database. The above only changes the data in the client table.Kevin
The example you are quoting is with Editor and the values are saved to and loaded from a database. That doesn't seem to be your use case.
Is your table dom sourced?
Please see this: https://datatables.net/examples/data_sources/dom
Thanks!