Hi,
When I double click the subgrid row, it opens 2 edit dialogs: one for the subgrid row and the other for the record related in the master grid.
I would like to open only the edit dialog for the subgrid row.
It would be great to disable the double click action in the subgrid and keep it on the master grid.
Let me know if you've got any thoughts.
Many thanks.
To have double click event binded on one grid, e.g. list1, you can have var as opts_list1 (where list1 is grid id)
<script>
var opts_list1 = {
'ondblClickRow': function (id) {
jQuery(this).jqGrid('editGridRow', id, <?php echo json_encode_jsfunc($g->options["edit_options"])?>);
}
};
</script>
The issue was, when you double click subgrid, it was invoking event for subgrid as well as master grid (because subgrid was inside master grid's td)
Solution was to stop the event propagation when dblclicked on subgrid row.
<script>
var grid_id = <?php echo $c_id;?>;
var grid = $("#_list1_"+grid_id);
var opts_<?php echo $g->id?> = {
'ondblClickRow': function (id,row,col,e) {
jQuery(grid).jqGrid('editGridRow', id, <?php echo json_encode_jsfunc($g->options["edit_options"])?>);
e.stopImmediatePropagation();
}
};
</script>