1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Vote Rating
    2
    Answers
    7
    UbuntuPenguin is on a distinguished road

      0  

    Default Unanswered: Routes misunderstanding.

    Unanswered: 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    Answers
    3109
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Vote Rating
    2
    Answers
    7
    UbuntuPenguin is on a distinguished road

      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