Results 1 to 6 of 6

Thread: is it possible to stop event propagation form controller?

  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84
    Vote Rating
    0
      0  

    Exclamation Answered: is it possible to stop event propagation form controller?

    i have grid with defined itemdblclick event handler(that would be default behavior), i also have specified in Controller.control() other handler for event on that particular grid.

    I d wish to have possibility to stop event propagation form the controller and not from the component. Now it works other way around. (returning false in component will prevent controller.controll handling)

    Can this be done?

  2. Controllers are event driven but if there isn't a cancelable event then there isn't much a Controller can do. You can create an override to add a before event if you need one. Then a Controller can cancel it.

  3. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    All events should pass in the EventObject which if you execute stopEvent() then it should stop the event from bubbling up.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #3
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84
    Vote Rating
    0
      0  

    Default

    my question is about direction of bubling.

    im in controller and heve my listener fired then i can stop propagation BUT event handler defined int he component itself fires before it. so it wont be stopped (it already happened).

    am i wrong?

  5. #4
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    If it is being listened internally by a widget, unless there is a before event that you can return false to stop it, there is no way.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  6. #5
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84
    Vote Rating
    0
      0  

    Default

    ok. so im a little disappointed in controlling possibilities of controller. I guess it wont be changed?

  7. #6
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    Controllers are event driven but if there isn't a cancelable event then there isn't much a Controller can do. You can create an override to add a before event if you need one. Then a Controller can cancel it.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •