Ext JS - Learning Center

Tutorial talk:Extending Ext for Newbies

From Learn About the Ext JavaScript Library

Jump to: navigation, search

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.
  • This page was last modified on 24 September 2009, at 18:04.
  • This page has been accessed 131 times.