View Full Version : Possible to overload so a function gets called before a listener?

Tim Toady
11 Mar 2010, 2:21 PM
I want to write an override to prevent a treeloader from loading if a property is not set (basically an autoLoad). The first thing that comes to my mind is trying to override beforeLoad, however my override will be overridden if I later try to use beforeload in a trees listeners. Is there a way I can force EXT to call a function before a specific listener? I am more after this last question than the answer to the problem that led me to it.


After looking back at this months later I think I can answer my own question. Basically to prevent a listener in an override from being overriden you need to append the listener instead of setting it as the listener. So in the constructor after you apply the arguments to the superclass you can say something like

this.on("load", this.onLoad, this); for any listener you want.