PDA

View Full Version : OverRiding Ext.Element Methods (new syntax (addMethod())



brookd
13 Jul 2009, 10:42 AM
While upgrading from 2.0 to 3.0, I needed to update an overRide I had on Ext.Element.mask. I notice that the Ext.Element is now created via multiple JS files that call


Ext.Element.addMethods({}

It looks like some vars are set within a closure (docs/source/Element.fx-more.html#method-Ext.Element-mask). But these variables are not available to the function if I override the mask
function via Ext.override(Ext.Element,{
mask:function(){
alert('Your mamas so fat')
}
})

Rather than copy those variables and re-create them local of the function - is there a better way to overRide an Ext.Element method?

jay@moduscreate.com
13 Jul 2009, 11:14 AM
If the method that you're looking to override (not overRide) have visibility into local variables, then no.