JQGrid 在页面加载时展开SubGrid

时间:2023-03-08 19:36:08

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

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

JQGrid 在页面加载时展开SubGrid

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

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

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

相关文章