I have a jqgrid that has a subgrid. How can I expand the subgrid without having to click on the plus sign?
I came across $("#jqgrid_id").expandSubGridRow(ro开发者_如何转开发wId); but am unsure which rowId to use to expand the subgrid.
Thanks.
Use $("#jqgrid_id").expandSubGridRow(rowId); in the onSelectRow Event of the grid.
Something like this:
jQuery("#jqgrid_id").jqGrid({
...
   onSelectRow: function(rowId){ 
      $("#jqgrid_id").expandSubGridRow(rowId); 
   },
...
});
EDITED: on GridComplete event
jQuery("#jqgrid_id").jqGrid({
...
   gridComplete: function(){ 
      var rowIds = $("#jqgrid_id").getDataIDs();
      $.each(rowIds, function (index, rowId) {
        $("#jqgrid_id").expandSubGridRow(rowId); 
      });
   },
...
});
Change getDataIds() to getDataIDs()!
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论