1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    126
    Vote Rating
    0
    varunach is on a distinguished road

      0  

    Default Learning : How does Ext JS listen/attach listeners before component creation

    Learning : How does Ext JS listen/attach listeners before component creation


    According to the MVC Application Architecture, the controller's init method is called before the launch() method of the Application is called. In the same tutorial, the component is created in the launch() method, where as the init() method calls the control() method of the Controller classand starts listening to the events before the components are created . How does Ext JS hold the events before and then attach the events to the appropriate components after the components are created?

  2. #2
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    941
    Vote Rating
    66
    westy is just really nice westy is just really nice westy is just really nice westy is just really nice

      0  

    Default


    I used to think it was flawed too, until someone pointed out that it's evaluated at the time of the event.

    Have a look at the Ext.app.EventBus class.
    Product Architect
    Altus Ltd.

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    126
    Vote Rating
    0
    varunach is on a distinguished road

      0  

    Default


    Yes, I did go through that class earlier too. From what I understood, they seem to have reversed it. Instead of looping through the handlers attached to the events on a component, they loop through all the selectors defined in all the controllers that are bound to the event and then fire the matching handlers.

    I wonder if my understanding is correct.

Thread Participants: 1

Tags for this Thread