如何在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);