Tutorial talk:Extending Ext for Newbies (Legacy)
This version of our Learning Center is unmaintained.
This article may be out-of-date or contain incorrect information.
Please visit the new Sencha Learning Center for up-to-date material.
From Sencha - Learn
Saki's definitive blog series, Writing a Big Application in Ext (Part 2),[1] ... all (currently three) parts of which are required reading ... makes the important point that if you use the "listeners" property in your config, you need to take special steps to ensure that it does get processed.
This is not the only way to register an event-handler, but it is a common one. If you (or your component's clients) are relying upon configuration properties to do this chore, "InitComponent" is too late.
The key point that Saki's post gives (go read it!) is this:
- The superclass constructor-chain is run first, before the InitComponent method-chain is run.
- The constructor of Observable looks for the "listeners" property's existence and processes it at that time. Any additions that you subsequently make in "InitComponent" therefore will not be seen.
