reload array data on grid2 dependent upon grid1

Questionsreload array data on grid2 dependent upon grid1
Rob asked 11 years ago

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

1 Answers
Abu Ghufran answered 11 years ago

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.

Your Answer

0 + 5 =

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?