当存储与网格面板加载关联时,我想在 ExtJs 5 的网格面板中隐藏一列。
Depending on how your data store works.... there is onload event. Hide your column on that event.
使用以下语法,您可以实现它:
<yourGrid>.down('headercontainer').getGridColumns()[<columnIndex>].hidden = true;
如果您知道要隐藏的列的索引,则可以在 store load 事件触发后使用此代码
grid.getColumnManager().getHeaderAtIndex(indexOfColumn).hide()
You can find the api from manual [Ext.grid.column.Column-method-hide]: http://docs.sencha.com/extjs/5.0/5.0.1-apidocs/#!/api/Ext.grid.column.Column-method-hide
There is a fiddle for you: http://runjs.cn/code/qusp7pql
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.