如何在extjs中动态显示/隐藏列? [英] How to dynamically show/hide columns in extjs Grid?

查看:525
本文介绍了如何在extjs中动态显示/隐藏列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何在网格面板中显示/隐藏列

在extjs gridpanel中,有一个名为:visibleColumns的属性。
我想要的是:

In extjs gridpanel, there is an attribute called : visibleColumns. What I want is this:

someGrid = new Gridpanel({
store: this.someStore,
flex: 1,
if (someCond=true)
visibleColumns:[
col1,col2
]
else
visibleColumns:[
col3,col4
]
});

如何实现if(someCond = true)?

How to achieve the if (someCond=true) ?

推荐答案

你必须尝试这样的东西:

You have to try something like that:

someGrid.getColumnModel().setHidden(0, true);

这篇关于如何在extjs中动态显示/隐藏列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆