Update data of different table on postEdit/postCreate
Update data of different table on postEdit/postCreate
Link to test case:
can provide, on request and privately, link to page in my dev environment
Description of problem:
In a page I have 3 tables (A , B , C).
When I edit (or create a new ) line in table A, I need to update a specific column of a row in table B, with the sum of the values of a column in table A..
I have tried with postEdit
and postCreate
events, but the sum I get by iterating each table As' rows are the old ones (before the data is being updated in dt).
Am I using the wrong event ? Should I use something else ?
This question has an accepted answers - jump to answer
Answers
It would be worth using
submitComplete
for that - see example here. This is summing the "Age" column in the first table and adding it into the second - this is the relevant code:Colin
Hi Colin,
thanks for that .
I haven't used
submitComplete
because reading the doc I thought it was related to ajax sourced datatables only,best regards
It's when the submission completes. Are you using Ajax? If not, how are you sending the data back to the server?
Colin
I am not using ajax.
In our program there is no "live" inserting/editing, therefor all save/insert of records are done when the user confirms the operation.