dojo – 动态隐藏dgrid中的列
发布时间:2020-12-16 21:20:15 所属栏目:百科 来源:网络整理
导读:如何根据一些运行时参数隐藏dgrid(gridFrom Html)中的完整列? 让我们说如果参数的值为true我应该能够显示一些列,如果值为false,那么我应该能够隐藏同一列. 解决方法 使用grid.styleColumn(columnId,css): var grid = new Grid({ store: store,columns: [ {
如何根据一些运行时参数隐藏dgrid(gridFrom
Html)中的完整列?
让我们说如果参数的值为true我应该能够显示一些列,如果值为false,那么我应该能够隐藏同一列. 解决方法
使用grid.styleColumn(columnId,css):
var grid = new Grid({ store: store,columns: [ { id: "artist",label: "Artist",field: "Artist"},{ id: "name",label: "Song",field: "Name"},{ id: "gerne",label: "Genre",field: "Genre"} ] },"grid-placeholder"); // to hide column with id="name" grid.styleColumn("name","display: none;"); // to show it grid.styleColumn("name","display: table-cell;"); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |