PDA

View Full Version : Ext.grid.column.Column.hide() does not work when not rendered



JorisA
6 Dec 2013, 4:35 PM
Ext version tested:
Ext 4.2

Browser versions tested against:
Chrome 31.0.1650.63

Description:
When the ownerHeaderCt for the column already exists, but it has not been rendered yet this function will have no effect (column will show as soon as the grid is rendered).

I think the problem is caused by (source (http://docs.sencha.com/extjs/4.2.2/source/Column3.html#Ext-grid-column-Column-method-hide)):


hide: function(fromOwner) {
[...]
if (!me.isVisible()) {
// Already hidden
return me;
}
[...]
}


which calls (source (http://docs.sencha.com/extjs/4.2.2/source/AbstractComponent.html#Ext-AbstractComponent-method-isVisible)):


isVisible: function(deep) {
var me = this,
hidden;

if (me.hidden || !me.rendered || me.isDestroyed) {
hidden = true;
} else if (deep) {
hidden = me.isHierarchicallyHidden();
}

return !hidden;
},


Causing the function to abort without setting the hidden flag.
The workaround that supports this is:


col.hide();
col.hidden = true;

Gary Schlosberg
10 Dec 2013, 4:37 PM
Thanks for the report. If I understand correctly, I'm not sure this is a bug. If a component hasn't rendered yet, then I wouldn't expect to be able to call methods on it. If I have misunderstood or you disagree, please post a test case which exhibits the issue.