In a working jqGrid with subGrid how I can hide the column where appears the plus/minus/open icons completely?

孤者浪人 提交于 2019-12-05 02:20:25

问题


I want hide it completely from the main grid too.

See image for more clarification.

Thanks in advance.


回答1:


The column which you need to hide has the name "subgrid". So to hide it you can use

$("#grid").jqGrid("hideCol", "subgrid");

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);
}

See the corresponding demo here:

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" }

and add additional CSS style

.subgrid-cell .ui-helper-hidden { display: none}

See the updated demo:

UPDATED 2: To hide the column with the icon in the subgrid row you can just use

.subgrid-cell { display: none}

See the next demo:



来源:https://stackoverflow.com/questions/12439147/in-a-working-jqgrid-with-subgrid-how-i-can-hide-the-column-where-appears-the-plu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!