gpt4 book ai didi

jquery - 扩展jqgrid子网格

转载 作者:行者123 更新时间:2023-12-03 22:37:40 25 4
gpt4 key购买 nike

我有一个带有子网格的 jqgrid。如何在无需单击加号的情况下展开子网格?

我遇到了 $("#jqgrid_id").expandSubGridRow(rowId); 但不确定使用哪个 rowId 来扩展子网格。

谢谢。

最佳答案

在网格的onSelectRow事件中使用$("#jqgrid_id").expandSubGridRow(rowId);

类似这样的事情:

jQuery("#jqgrid_id").jqGrid({
...
onSelectRow: function(rowId){
$("#jqgrid_id").expandSubGridRow(rowId);
},
...
});

已编辑:在 GridComplete 事件上

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

关于jquery - 扩展jqgrid子网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3345401/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com