Explain ExtJS 4 event handling

后端 未结 5 1423
孤街浪徒
孤街浪徒 2020-11-30 16:09

I\'ve recently started learning ExtJS, and have trouble understanding how to handle Events. I have no experience of any previous versions of ExtJS.

From reading var

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 16:37

    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);
    });
    

提交回复
热议问题