使用 + 隐藏列plus 用于在 jqgrid 中显示子网格
知道如何隐藏带有 + 图标的列,该图标显示 asp mvc 的 jqgrid 的子网格。我有另一列显示子网格,我想隐藏加号列。有什么想法吗?谢谢。
Solution:
function OnGridInitialized() {
$('#UserSessionGrid').jqGrid('hideCol', 'subgrid');
}
In c# code:
userSessionsGrid.ClientSideEvents.GridInitialized = "OnGridInitialized";
Any idea how I can hide the column with the + icons that displays the subgrid of a jqgrid for asp mvc. I have another column that displays the subgrid and I will like to hide the plus column. Any ideas? Thx.
Solution:
function OnGridInitialized() {
$('#UserSessionGrid').jqGrid('hideCol', 'subgrid');
}
In c# code:
userSessionsGrid.ClientSideEvents.GridInitialized = "OnGridInitialized";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
带“+”号的列在很多意义上就是jqGrid的普通列。它的列名称为“subgrid”:
存在三种非常接近的情况:
subgrid: true
选项,则它存在;multiselect: true
,则它存在;rownumbers: true
,则它存在。因此,可以根据
hideCol
隐藏列中的任何内容。另一方面,名称“subgrid”、“cb”和“rn”是保留名称,不能使用该名称作为name
属性的值。The column with "+" sign is in many sense just normal column of jqGrid. It has the column name "subgrid":
There are three very close cases:
subgrid: true
are used;multiselect: true
are used;rownumbers: true
are used.So one can hide any from the columns with respect of
hideCol
. On the other side the names "subgrid", "cb" and "rn" are reserved names and one can't use the name as the value of thename
property.我刚刚查看了 jqGrid 演示并对其运行了此演示,您可以在准备好的文档中运行它:
希望这就是您正在寻找的内容。
I just looked at the jqGrid demo and ran this against it, which you can run inside document ready:
hopefully this is what you are looking for.