I have 2 separate grids displayed on a page. Grid 1 is editable and Grid 2 is only displaying different data based on Grid 1's data. In my example I have users entering in production numbers.. calculations are made and entered into an array for Grid 2. However, when Grid 1 is saved Grid 2 is not updating without refreshing the whole page. I've gotten Grid to clear the old data but it's not updating.. So on the inital page load everything displays perfect.. when I edit on Grid 1 and hit save Grid 2 goes blank. Here's code:
/// GRID 1 Code ///////////////////////////////////
$grid["onAfterSave"] = "do_onload";
$g->set_options($grid);
$e["on_update"] = array("update_lspk", null, false);
$g->set_events($e);
/// function update_lspk & Calling Grid 1 info///////
$d0 = $data["params"]["d0"];
$d1 = $data["params"]["d1"];
…. calculations …..
// Grid 2 data array after calculations/////////////
$datab[$i]['d0'] = $calculations;
$datab[$i]['d1'] = $calculations2;
/// End of function ///////////////////////////////
/// function do_onload //////////
function do_onload()
{
jQuery('#list2').jqGrid('clearGridData');
jQuery('#list2').jqGrid('setGridParam', {data: datab});
jQuery('#list2').trigger('reloadGrid');
}
This is on a local server, teamviewer is available if needed
Please email me (at [email protected]) complete code and sample db sql dump to generate case.
This is something new, and i don't have a working demo of grid -> array grid yet.