However, when in a event that is in a php routine what would that look like?
function update_groups(&$data){
global $list_main;
– do stuff here to update database tables
In javascript I would reload grid like this, but what can I do here?
$("#list1").trigger("reloadGrid", [{current:true}]);
}
You can put reload option in inline:
$opt["onAfterSave"] = 'function() { $("#list1").trigger("reloadGrid", [{current:true}]); }';
$g->set_options($opt);
For dialog,
$grid["edit_options"]["afterSubmit"] = "function(){jQuery('#list1').trigger('reloadGrid',[{current:true}]); return [true, ''];}";
Thanks Abu,
Sorry, I was not clear.
I meant reloading a different grid.
So you edit list1 and in the then you do a query to list2.
List2 needs to be refreshed.
list1 event
$aevent["on_update"] = array("update_groups", null, true);
function update_groups(&$data){
– do stuff here to update database tables that list2 comes from
– how to update list2?
}
Ok, currently you cannot have JS reload code in on_update handler.
If you want to reload list2, in my previous reply, you can simply change list1 to list2.
And add onAfterSave and onsubmit options to list1 grid settings.
Hi Abu,
Trying this again and still can not get it to work.
I changed one line of code in your demo master-multi-detail.php
http://websalesdesign.com/proj/lib/phpgrid-full/index.php
http://websalesdesign.com/proj/lib/phpgrid-full/demos/master-detail/master-multi-detail.php
I just put the line
$opt["onAfterSave"] = 'function() { $("#list1").trigger("reloadGrid", [{current:true}]); }'; // jqgrid_page:1
$grid->set_options($opt);
With this line Invoice data record will not save.
Is there another line I need to add. Was not sure what onsubmit option was.
Thanks
Glenn
Perhaps, I am unable to understand the issue.
I tried editing grid row with grid header 'invoice data'
change amount from 100 to 1
It refreshed the top most grid, and make other detail grids blank.
i selected same row from top grid and it display changed record.
Please correct what i am missing.
Hi Abu,
I tried it with the link that I sent to the code on my server and could not change any value in the Invoice Data grid.
I don't see any value of 1 so maybe you were using a different grid.