PDA

View Full Version : Is there any difference between these two statements in ext?



exting
20 Feb 2012, 7:48 PM
Ext.override(Ext.util.Observable, {
releaseCapture: function(o) {
o.fireEvent = Ext.util.Observable.prototype.fireEvent;
};
});


and



Ext.util.Observable.releaseCapture = function(o) {
o.fireEvent = Ext.util.Observable.prototype.fireEvent;
};

Is there any difference between these two statements in ext(seems identical to me)?

burnnat
21 Feb 2012, 4:53 AM
Using Ext.override() allows you to call this.callOverridden() within the function to execute the original function that's being replaced. You aren't able to do that if you just overwrite the prototype method directly.

exting
14 Mar 2012, 11:35 PM
But in this specific case this.callOverridden() is not called,so they're identical,right?