简体   繁体   English

Kendo UI详细信息网格隐藏列

[英]Kendo UI Detail Grid Hide Columns

I need a way to dynamically display/hide columns in the Kendo Detail Grid. 我需要一种在Kendo Detail Grid中动态显示/隐藏列的方法。 I currently have a function that will hide columns of the Parent piece of the Kendo Grid, using the .hideColumn("ColName") function. 我目前有一个函数,它将使用.hideColumn(“ ColName”)函数隐藏Kendo Grid的Parent块的列。 Example: 例:

var grid = $("#grid").data("kendoGrid");

grid.hideColumn("Column1");

Is there a way to utilize the .hideColumns function to hide the columns of a Detail Grid? 有没有一种方法可以利用.hideColumns函数隐藏明细网格的列?

I figured it out. 我想到了。 By using assiging the ID to the grid in the detailInit function, I can reference the child grid and use the .hideColumn function. 通过在detailInit函数中将ID辅助到网格,我可以引用子网格并使用.hideColumn函数。

Declaration in detailInit function: 详细声明Init函数:

var detailGrid = $("<div id='detailGrid' />").appendTo(e.detailCell).kendoGrid({
...
});

Function: 功能:

var grid = $("#detailGrid").data("kendoGrid");    
grid.hideColumn("Column1");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM