Just two more things I found helpful to know, even if they are not part of the question, really.
You can use the relayEvents
method to tell a component to listen for certain events of another component and then fire them again as if they originate from the first component. The API docs give the example of a grid relaying the store load
event. It is quite handy when writing custom components that encapsulate several sub-components.
The other way around, i.e. passing on events received by an encapsulating component mycmp
to one of its sub-components subcmp
, can be done like this
mycmp.on('show' function (mycmp, eOpts)
{
mycmp.subcmp.fireEvent('show', mycmp.subcmp, eOpts);
});