Results 1 to 5 of 5

Thread: View controllers hierarchy

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium User
    Join Date
    Oct 2011
    Location
    Paris
    Posts
    21

    Default 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

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    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.

  3. #3
    Sencha Premium User
    Join Date
    Oct 2011
    Location
    Paris
    Posts
    21

    Default

    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

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    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.

  5. #5
    Sencha Premium User
    Join Date
    Oct 2011
    Location
    Paris
    Posts
    21

    Default

    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

Similar Threads

  1. Why have both View Controllers and View Models in MVVM?
    By CoderDennis in forum Ext 5: Q&A
    Replies: 6
    Last Post: 22 May 2014, 6:01 AM
  2. Display hierarchy for navigation view
    By atkinsonline in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 21 May 2014, 4:24 PM
  3. Controllers send records to view, but how does my view set them?
    By jakejamessteele in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 10 Jun 2013, 8:35 AM
  4. Navigation View pop View breaks controllers config listeners.
    By munnaz1 in forum Sencha Touch 2.x: Discussion
    Replies: 8
    Last Post: 7 Nov 2012, 7:38 AM
  5. Replies: 1
    Last Post: 5 Jun 2011, 10:27 PM

Posting Permissions

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