Using editor to edit value before refreshing datatables
Using editor to edit value before refreshing datatables

Hello.
I'm using this is order to get the data submited before sending the ajax call.
editor.on( 'preSubmit', function ( e, data ) {
...
});
Inside that form, I have the value data.data_key
that is equal to 1 for example. I want to, before Datatables refreshes, to make this value equal to something else. How can I achieve that? I tried to do
editor.on( 'preSubmit', function ( e, d ) {
data.data_key = 3
});
But it doesn't seem to work, the refreshed Datatables contains the original value. Any idea on how can I go about this problem?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
To be clear, do you want to change the value before it's submitted to the server? Or you want to modify the data after the server responds to the submission?
Colin
@colin after the server responds, when re-writing the data to Datatables.
I have tried this :
But also this doesn't seem to change the updated data for the cell
data_key
...I found the answer while testing tons of things
For reference the list of events can be found here : https://editor.datatables.net/reference/event/
Perfect, glad all working.