Looks like we can't reproduce the issue or there's a problem in the test case provided.
-
Sencha Premium User
View controllers hierarchy
Hey guys,
I set a panel with a button and both of them have its own view controller.
https://fiddle.sencha.com/#fiddle/t2u
When I tap the button the app does not look for the listener on the button level but only on the panel.
Isn't the button view controller supposed to do that?
Thanks
Philippe
-
Twitter - @evantrimboli
Former Sencha framework engineer, available for consulting.
As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.
-
Sencha Premium User
I reviewed my fiddle and it works now.
Based on what you are referring to, the third button should only trigger the main controller method, but it triggers both. What would you advise in order to nicely overwrite the components' controller method by the parent's controller?
Thanks
-
You're adding 2 listeners, they get merged upon construction time. The one on the class definition is mapped to the button controller. The other to the parent because it's on the instance.
Practically, I don't really see why you would have a controller on a button like that, seems rather odd.
Twitter - @evantrimboli
Former Sencha framework engineer, available for consulting.
As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.
-
Sencha Premium User
That was just for test purpose.
What I am trying to achieve is to work with nested components which may have their own controllers or may be overwritten by the parent's controller.
Thanks for your feedback
Philippe