PDA

View Full Version : Override Method



hitman01
16 Sep 2010, 11:00 AM
I'm trying to override a next() and prev() method in Carousel. How can I include the parent method call into my new method?

Ext.override(Ext.Carousel, {
next: function(){
parent.next();
},
});

Also, how can I include this statement into my class new Ext.Carousel({

evant
16 Sep 2010, 5:08 PM
You could save a reference to it.



var hide = Ext.Component.prototype.hide;

Ext.override(Ext.Component, {
hide: function(){
// do nothing
hide.call(this);
}
});

Ext.onReady(function(){
var c = new Ext.Component({
html: 'foo',
renderTo: document.body
});
c.hide();
});