扩展jqgrid子网格 [英] Expanding jqgrid subgrid
本文介绍了扩展jqgrid子网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有子网格的jqgrid.如何在不单击加号的情况下扩展子网格?
I have a jqgrid that has a subgrid. How can I expand the subgrid without having to click on the plus sign?
我遇到了$("#jqgrid_id").expandSubGridRow(rowId);
,但是不确定使用哪个rowId来扩展子网格.
I came across $("#jqgrid_id").expandSubGridRow(rowId);
but am unsure which rowId to use to expand the subgrid.
谢谢.
推荐答案
在网格的onSelectRow事件中使用$("#jqgrid_id").expandSubGridRow(rowId);
.
Use $("#jqgrid_id").expandSubGridRow(rowId);
in the onSelectRow Event of the grid.
类似这样的东西:
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);
});
},
...
});
这篇关于扩展jqgrid子网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文