Hi,
I have 2 grids on the same page and are not related. The 2nd grid is a report calculated based on the entries of the 1st and is referencing a sql view.
When there’s an update or input in the first table, how can I refresh the 2nd table? Is there a javascript script call that can be made?
Thanks
If your second grid is called list2 you should be able to update it with the following Javascript:
jQuery(‘#list2’).trigger(“reloadGrid”,[{page:1}]);
The Q&A question below shows a few more examples of how to reload the grid, just adjust the name parameter to match your second grid:
How to reload/refresh grid using javascript code (e.g. button click)?
Thanks Richard, it helped greatly to search thru all the questions and here is my solution:
$opt[“onAfterSave”] = “function(){jQuery(‘#grid_summary’).trigger(‘reloadGrid’,[{jqgrid_page:1}]); return [true, ”];}”;
$g->set_options($opt);
$out = $g->render(“grid_rr_discipline_plan”); //first table
$out_summary = $g2->render(“grid_summary“); //second table