Results 1 to 3 of 3

Thread: Routes misunderstanding.

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Answers
    7
    Vote Rating
    2
      0  

    Default Routes misunderstanding.

    Hello Everyone,
    Here is my use case, when a specific route ( 'biscuitlocator' ) is triggered, I need 2 controllers to perform certain actions to their respective views. However, this isn't working in my application as the url changes but the view doesn't. If I comment out one route in a controller but not the other it works and hits my route dependent code, but it doesn't work when I have 'biscuitlocator' in both controllers.

    I was thinking I had a misunderstanding about routes and how they work with the various controllers of the application.

    Any help is greatly appreciated.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You will need to daisy chain the controller methods. Have only one route and in that handler execute a method in the other controller via:

    Code:
    var controller = this.getController('secondcontroller')
    
    controller.someFn.apply(controller, arguments);
    Or you can have an abstract controller and have another controller extend it. Then just like in a view you can callParent to execute the superclass' method also.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Answers
    7
    Vote Rating
    2
      0  

    Default

    When you say use an abstract controller, do you mean have a controller that is the parent class of all of my controllers and contains all the routes, so each one can respond ?

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
  •