How to programmatically update a cell's value?
How to programmatically update a cell's value?
In editor.on('preSubmit', function (e, o) {
I want to update the value of a readonly cell, totalPrice
.
My code basically looks like this:
if (o.data.quantityOrdered > 0 && o.data.unitPrice > 0) {
o.data.totalPrice = o.data.quantityOrdered * o.data.unitPrice;
}
table.row(x).data(o.data).draw();
Above does not refresh the value shown in the cell. How should I be doing this?
Thank you.
This discussion has been closed.
Answers
The above will submit
totalPrice
to the server as calculated. Does the server then process that data and return it for the edited row?Allan
Hi Allan, sorry, I had meant to indicate that I'm not using a server. I'm using the JavaScript / CSS only package.
Okay - but the point still stands. The data must be submitted somewhere processed and stored, then the data returned as per the client / server communication.
Allan