问题描述
我也想将其完全隐藏在主网格中.
I want hide it completely from the main grid too.
查看图片以获得更多说明.
See image for more clarification.
预先感谢.
推荐答案
您需要隐藏的列的名称为"subgrid"
.要隐藏它,您可以使用
The column which you need to hide has the name "subgrid"
. So to hide it you can use
$("#grid").jqGrid("hideCol", "subgrid");
如果您需要实现用于打开或关闭子网格的接口,则可以调用 toggleSubGridRow 方法.例如,以下回调将在双击主行时切换子网格:
If you need to implement interface for opening or closing subgrids you can call toggleSubGridRow method directly. For example the following callback will toggle subgrid on double-click on the main row:
ondblClickRow: function (rowid) {
$(this).jqGrid("toggleSubGridRow", rowid);
}
在此处:
已更新:如果要在子网格的第一列中另外隐藏图标,可以使用选项
UPDATED: If you want to hide additionally the icon from the first column of subgrid you can use the option
subGridOptions: { openicon: "ui-helper-hidden" }
并添加其他CSS样式
.subgrid-cell .ui-helper-hidden { display: none}
请参见更新的演示:
更新2 :要隐藏子网格行中带有图标的列,您可以使用
UPDATED 2: To hide the column with the icon in the subgrid row you can just use
.subgrid-cell { display: none}
请参见下一个演示:
这篇关于在带有subGrid的可工作的jqGrid中,我如何隐藏完全显示加号/减号/打开图标的列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!