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

 

posted @ 2018-04-19 17:03  幽冥狂_七  阅读(689)  评论(0编辑  收藏  举报