JQGrid 在页面加载时展开SubGrid

1、jqgrid在加载完成之后展开SubGrid,用得如下办法:

gridComplete: function () {
                  var rowIds = $("#list2").getDataIDs();
                      $.each(rowIds, function (index, rowId) {
                                $("#list2").expandSubGridRow(rowId);
                            });
                  }

2、第二种方式:jqgrid异步加载数据的

gridComplete: function() {
                var timeOut = 50;
                var rowIds = $("#list11").getDataIDs();
                $.each(rowIds, function (index, rowId) {
                    setTimeout(function() {
                        $("#list11").expandSubGridRow(rowId);
                    }, timeOut);
                    timeOut = timeOut + 200;
               });
   }

来源:https://blog.csdn.net/hu764525403/article/details/50234155?locationNum=2&fps=1

原文地址:https://www.cnblogs.com/youmingkuang/p/8884378.html