Hi I made a master/detail form : I choose a customer account in master I display entries on detail beside, à custom form: When I click on a entry, I display details on custom form and I can enter a payment (kind of payment, amount,date) On validation, I execute a php function to create accounting writing and update customer account. All that stuff in the same PHP CODE with testing value of validation button. My problem: After executing my function (create and update accounting) I come back on new master/detail grids And I would like to keep selected data, same account in master, same customer in detail How to do that ? whether it\’s possible…. Regards Georges
It’s little difficult to suggest something without any screenshot or code.
If you want to retain previous selections on page reload,
you can check: https://www.gridphp.com/docs/state-persistence.html?h=persis#state-persistence
Please share more details with screenshot for better understanding.
You can also email at support@gridphp.com
Hi
Yes I found this example
It works for master grid
But how to do that on detail grid too ?
Many thanks for your help!
If your detail grid object is $g, You can get detail grid ID by: $gid = $g->id.
Then in the code, you can set state persist settings like below: e.g. opt_list1 will become:
var opts_ = {
…
};
I’m sorry, but I don’t understand
i have $g= new jqgrid($db_conf); master
$h = new jqgrid($db_conf); detail
i need to do $gid = $g->id and $hid = $h->id
and then ?
what do i do with $gid et $hid ?
where I put them in my script ?
do i have to do One Script for both ? or one part of script for each ?
Regards
Georges
Sorry for the delay.
It’s like we do on line 145 of https://www.gridphp.com/demo/demos/misc/persist-settings.phps
Along with master grid persist setting, we will use detail grid persistence as well before showing output of detail grid.
var opts_<?php echo $hid?> = {...};
If still unclear, share or email you code and I’ll suggest the changes.
Check complete reply on support forum. Email may have incomplete post.

