Hmm…, how do I paste code here? I tried the “code” in square brackets tags but they don’t work.
I mentioned the “detail” example in the demo because I also have a page with 2 grids, but in my case the second grid does not need any rowid from the first grid.
I just need to refresh the second grid every time I add (or edit, delete) a row in the first grid.
Here is the code that I use:
The <body> section of the html file (actually it’s a .php file):
In cashron-grid1.php I have:
The purpose is to refresh the grid in cashron-grid2.php every time I add/edit/delete in cashron-grid1.php.
Grid2 does not need a rowid from the changed row in grid1. It just calculates some totals, but with different WHERE statements in the SQL query.
I use formedit.
I want to achieve something similar to your demo at:
in “Selection” -> “Master detail on select”.
There the “detail” grid gets refreshed every time a row is selected in the grid above.
What I need is the same refresh of the “detail” grid (in my case it’s called “balances”), only I need it to happen when a row is added or edited or deleted in the first grid.
The event “afterSubmit” does not seem to work for me. If I replace it with “onRowSelect”, it works on selects, so all the other code is correct, it’s just the event that needs to be changed, and I don’t know which is the correct one.
Thanks, it worked!
Sorry for not seeing the related information in that thread.
So, the code you posted in that thread is for jqGrid JS:
storeNavOptions : true,
For PHP it is like this?
$grid->storeNavOptions = true;
Does it matter the position in the code for this line? Can I put it right after:
$jscode = <<<CODE
Thanks, it worked!
Also, can you tell me if there’s an easy way to make the grey background (behind the add and edit panels) only cover the grid that is being added or edited? Right now it covers the entire page, including my second grid. (should I create a different thread for this?)
I am displaying a second grid below the main one. The second grid show entries that were added that day and I need to use an event in the main grid to trigger a refresh of the second grid.
So in the main grid I tried to use the following:
$refreshtoday = <<<ENDTODAY
But the above triggers the refresh for every row the main grid displays (so if I have 20 rows per page, the event triggers 20 times). I wanted to trigger only when a new row is added (via the add panel).
Thank you for the info.
For anyone having the same problem, here is how to do it: