So we have a need that in a parent row we change a value (a percentage) and then take that new value and potentially apply to rows in detail table. Once that is all complete need to take results from the applying the percentage to details rows and update another value in the parent row,.
Basically Parent has a discount percentage. Change the value from say 10% to 20%.
Now go row by row in detail table and potentially discount the price of the each row if they meet a criteria.
I have this working already. At the end do a detailGrid.datasource.sync() and looks good.
Next need to go through the detail table and grab all the changed prices and total them up and put in the parent row total column.
I keep the total during the updating of the detail rows.
Thought doing a parentRowModel.set("Total",newTotal) and then parentGrid.datasource.sync() would do it, but no luck.
Also at the very end we dont want the parentGrid.datasource.sync() to close the detail table. Want it to remain expanded.
What I think is happening is the parentGrid.datasource.sync() is causing the detail table to be restored to original value.
Expect:
User changes parent.
Code changes all of the detail rows that meet a criteria
Code syncs detailGrid to update the UI
Code syncs the parentGrid to update the parent row changed from calculations
User reviews the changes and manually saves to push changes back to database.
User needs to be able to make changes to multiple parents and details before committing change to database.