Good morning .
I have a master grid with a combo field , I need you on the value of the combo some data or other display in a subgrid .
That is, depending on the value of a select from the main grid , will change the select ( SQL ) of the secondary grid and the grid is updated.
Is this possible ?
Greetings and thanks .
Hello,
You can bind onchange event of master grid dropdown with a JS callback function.
In that function, you will need:
1) Set dropdown value in URL querystring of grid.
2) Reload the second grid.
// connect js function with onchange event
$col["editoptions"]["onchange"] = "reload_grid2(this)";
// js callback in html part
function reload_grid2(o)
{
var v = o.value;
var old_url = jQuery('#list2').getGridParam('url');
old_url = old_url + '&val='+v;
jQuery('#list2').jqGrid('setGridParam',{url: old_url, editurl:old_url, cellurl:old_url, jqgrid_page:1});
jQuery('#list2').trigger('reloadGrid',[{jqgrid_page:1}]);
}
I've not tested this code. This is just to give some idea.