-
21 Feb 2012 8:54 PM #1
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.
-
22 Feb 2012 6:24 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3109
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:
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.Code:var controller = this.getController('secondcontroller') controller.someFn.apply(controller, arguments);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.
-
22 Feb 2012 10:54 AM #3
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 ?


Reply With Quote