Is it possible to change the hiddengrid options value of a detail grid depending on values in a mastergrid? So if groupid value = 0 have the detail grid hidden otherwise show it.
Thanks
In mastergrid, you need to connect onSelectRow event: (where list1 is master grid, list2 is detail)
$opt["onSelectRow"] = "function(id){ var gid = jQuery('#list1').jqGrid('getCell', id, 'groupid'); if (gid == 0) $("#list2").jqGrid('setGridState', 'hidden'); else $("#list2").jqGrid('setGridState', 'visible'); }";
$g->set_options($opt);
Thanks Abu,
Unfortunately, that had no effect.
To test it I also updated your master-detail.php demo with the line below.
http://websalesdesign.com/proj/lib/phpgrid-full/index.php
$opt["onSelectRow"] = "function(id){ var gid = jQuery('#list1').jqGrid('getCell', id, 'gender'); if (gid == 'male') $('#list2').jqGrid('setGridState', 'hidden'); else $('#list2').jqGrid('setGridState', 'visible'); }";
Regards,
Glenn
Hello,
line 28: Move onSelectRow with master grid options (from detail grid)
Code: http://hastebin.com/fahefihuwi.php
Hi Abu,
I tried what you suggested and it had no effect.
Did you get this code working on your end?