jqgrid - how to dynamic add subgrid in run time
I'm using jqGrid 1.5.2, and I have a grid as subgrid, both parent and subgrid are in cell edit mode.

In loadComplete event of the parent grid, I successful removed some of the subgrids which depended on the data of the row as the following:

    loadComplete: function() {
      var dataIds = $('#mygrid1').jqGrid('getDataIDs');
      for (var i = 0;i < dataIds.length; i++) {
        var data = $("#mygrid1").jqGrid('getRowData', dataIds[i]);
        if (data[i].hasChild='N') {
           var grid = $("#mygrid1");
           $("#"+dataIds[i]+" td.sgcollapsed",grid[0]).unbind('click').html('');
        }
      }
    }

The problem is 

the data[i].hasChild can be changed by the user on the parent grid, so I want the subgrid is able to be expanded again for the row. 

However, I don't know how to do it, can someone give me any help, please? Thank you.

jqgrid - how to dynamic add subgrid in run time
===

I'm using jqGrid 1.5.2, and I have a grid as subgrid, both parent and subgrid are in cell edit mode.

In loadComplete event of the parent grid, I successful removed some of the subgrids which depended on the data of the row as the following:

    loadComplete: function() {
      var dataIds = $('#mygrid1').jqGrid('getDataIDs');
      for (var i = 0;i < dataIds.length; i++) {
        var data = $("#mygrid1").jqGrid('getRowData', dataIds[i]);
        if (data[i].hasChild='N') {
           var grid = $("#mygrid1");
           $("#"+dataIds[i]+" td.sgcollapsed",grid[0]).unbind('click').html('');
        }
      }
    }

The problem is 

the data[i].hasChild can be changed by the user on the parent grid, so I want the subgrid is able to be expanded again for the row. 

However, I don't know how to do it, can someone give me any help, please? Thank you.
