custom-form-and-reload-grids

Questionscustom-form-and-reload-grids
Georges asked 3 days ago

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

5 Answers
Abu Ghufran Staff answered 3 days ago

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

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Georges answered 3 days ago

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!

Abu Ghufran Staff answered 3 days ago

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_ = {

};

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
georges answered 2 days ago

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

 

 

Abu Ghufran Staff answered 4 hours ago

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.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff replied 4 hours ago

Check complete reply on support forum. Email may have incomplete post.

Your Answer

15 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?