ExtJS6 Sencha:慢慢隐藏多列

ExtJS6 Sencha: Slowly hiding multiple columns

我有一个 table (Ext.panel.Grid):21 列 (Ext.grid.column.Column),50 行。用我的按钮隐藏 20 列大约需要 2 秒。我在循环中使用 column.setVisible(true) 方法。 在浏览器调试器-ext-all-debug.js中可以看到隐藏每一列的时候,很多时间花在了:

rootHeaderCt.onHeaderHide(me);
Ext.resumeLayouts(true);

在Ext.grid.column.Column中的hide()方法中。

是否有可能以某种方式加快这个过程?

grid.getView().getHeaderCt().suspendLayouts();

// 隐藏列

grid.getView().getHeaderCt().resumeLayouts(true);

Fiddle

感谢您的建议。

post 解决了我的问题。

在多个 hiding/showing 之前和 Ext.resumeLayouts() 之后使用 Ext.suspendLayouts()