Ext version tested:

Description:

  • Component.setVisible() has no effect when component is not rendered yet




Steps to reproduce the problem:

  • Create Grid

  • Cycle through columns and hide some using setVisible(false)




The result that was expected:

The result that occurs instead:

Currently I have to do:


Code:



// Create grid
Ext.suspendLayouts();

grid.headerCt.items.each(function(col) {
// Obviously this would be based on something dynamic
var visible = (col.itemId == 'test');
col.hidden = !visible;
col.setVisible(visible);
});

Ext.resumeLayouts(true);
// Add grid to parentCt

or:


Code:



Ext.define('ECL.override.Component', {
override: 'Ext.Component',

setVisible : function(visible) {
this.hidden = !visible;
return this[visible ? 'show': 'hide']();
}
});

Would it be an idea to make the override the standard behavior as this seems to be the intent.