PDA

View Full Version : event handler not working properly



mikebolton
22 Jun 2011, 9:20 AM
Hi All,

I'm new to Ext and I'm trying to mask a panel while a tree is expanding.



//handler for expand tree button
expandTree : function (button, event) {
//alert('begin expandTree: calling for mask');
var cmp = Ext.getCmp('portfolioTab');
if (cmp) {
cmp.getEl().mask('Loading...', 'x-mask-loading')
}
//alert('mask called');

//alert('calling for expand');
Ext.getCmp(this.id).getRootNode().expand(true);
//alert('expand called');

//alert('calling for unmask');
if( !this.isCollapsed() )
{
cmp.getEl().unmask();
//alert('unmask complete');
}

//alert('end of expandTree fx');
}


When the alerts are enabled it works fine, but without them there's no masking even though it takes several seconds for the tree to expand.

Can someone tell me what I'm doing wrong?

Thanks.

jarlau
22 Jun 2011, 5:27 PM
use beforeexpandnode (http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.tree.TreePanel&member=beforeexpandnode) & expandnode (http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.tree.TreePanel&member=expandnode) listeners of TreePanel.