Get KoolPHP UI with 30% OFF!

how to (refresh, update) parent row after inserting or editing a child grid?

Abraham
soo i have this record wich sums his childs $ items and i want everytime i edit insert or delete a row in the child grid the parent row recalculate the $ with out lossing the gridviewstate.
the main grid $ field is not a calculated colum its a mysql qury sum. soo i tried the:
<?php
   $grid->KeepGridResfresh=true;
   $grid->KeepViewState = true;
   $grid->KeepRowStateOnRefresh = true;
?>
grid.refresh();
grid.commit();

but the detail grid get closed.
if i just call grid.refresh(); the parent row wont recalculate.
thanks!!!
Posted Jun 26, 2017 Kool
Anthony Amolochitis
I believe you need both.
grid.refresh(); // tell grid to refresh
grid.commit(); // commit grid to server
Posted Jun 26, 2017 Kool
Abraham
I have it like that and it does not recalculate the parent row.
Posted Jul 3, 2017 Kool
Anthony Amolochitis
If you do a page reload afterwards, does the correct calculation occur?
Posted Jul 3, 2017 Kool
Abraham
shure i have test with.
document.forms[0].summit;
after the insert and edit.
and it do the main form postback then the page reolads but I lose grid state.
Posted Jul 7, 2017 Kool
Anthony Amolochitis
Are you using sessions? The grid will use sessions to keep gridview state. I'm not sure if the expanded row is part of the view state though.
You may need to use more javascript to keep the grid row in expanded state if the sessioning does not work.
Posted Jul 7, 2017 Kool