Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

Hybrid View

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    lrochfort is on a distinguished road

      0  

    Default Controller listen to custom events in Architect 2

    Controller listen to custom events in Architect 2


    Hi,

    I want to decouple my Controller from my View, and as such do not want my Controller to listen to events raised by particular View components, but rather to application specific events that are raised by the View.

    For instance, have the List select event fire an editRow event in the View and then have the Controller listen for this event and act accordingly.

    When adding a Controller Action in Architect 2 I'm not able to manually enter and EventBinding name, only select one of the standard ones for the component type.

    Is what I want to do sensible and is there an Architect 2 construct for it?

    Any advice would be appreciated.

    Regards,
    Laurence.

  2. #2
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

    Default


    You can add a listener in the init method of your controller:

    PHP Code:
    init: function(application) {
      
    this.addManagedListener(application'i18nChange'me.onI18nChangeme);
    },
    onI18nChange: function() {
      
    alert('onI18nChange');


  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    lrochfort is on a distinguished road

      0  

    Default


    Thank you kubens.

    FYI, addManagedListener is deprecated and has been replaced by addListener. http://docs.sencha.com/touch/2-0/#!/...anagedListener

  4. #4
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

  5. #5
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    38
    Vote Rating
    2
    rklowe01 is on a distinguished road

      0  

    Default


    but how would you fire an event from say, a button press, that would be handled by the controller. I added the following line to my button handler:

    this.fireEvent('CustomEvent', button);

    and my controller is set up to listed for onCustomEvent.

    But when I press the button , the controller function onCustomEvent is not called.

    If this can't work in Architect, is there another way to just call a controller function directly from within a button press handler? (or a way to call a global function)?

    Thanks in advance...

  6. #6
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    79
    Vote Rating
    4
    oldroy is on a distinguished road

      0  

    Default


    I'd like to know the same thing. In complex apps this would be something that architect would need to allow. Seems that controlling all components and their event directly by ref and control in the controller would make some really big, fat, ugly controllers. If you could have the choice to push some of that out to the views (which are really kind of "view-controllers" not purely views anyway) it would be nice.

    I'd like to know if there is a performance difference in your scenario. As in, does controlling the button by ref and control in the controller directly perform better/faster than firing a custom event and trying to manage that?