13 Dec 2012 1:23 PM #1
How to Create Custom Controllers, and Then Extend Them
I have not been able to find any answers to this in this forum or in the larger web, so I do not know if it is possible in Architect. It is a trivial thing to implement in Ext.js but can see no route to it in Architect. The "create override" button seems to be a possible path, but I cannot find any documentation on what this is actually used for or how to implement it.
The purpose in this is that I would like to have a custom base controller class, say for a page controller, which I can then extend as needed, eg for the homepage behavior. While there may be little shared behavior between the instances, it would be nice to not have to add a getPageName method to each by hand.
17 Apr 2013 8:54 AM #2
Have you found any solution to this? Even with the changes in Sencha Architect 2.2, I can't seem to find a way to achieve this.
17 Apr 2013 9:14 AM #3
Not in architect i have not. a "solution" we came up with was to do an override class for Ext.app.Controller, which then modified all controllers. But you need to be careful, as this is a global change.
12 Jul 2013 12:11 PM #4
- Join Date
- May 2010
- Sapiranga, Rio Grande do Sul, Brazil
- Vote Rating
Nothing on this yet? It would be really nice be able to change the extend.
15 Jan 2014 1:17 PM #5
you probably have an answer now but I had the same question and found the answer here
He gives an example of creating a base controller with view viewport functionality and then creating another controller that extends the first controller, thereby allowing the second controller to have access to the first controller's functions.
Mitchell Simoens gives other examples of calling other controller functions here.
I used to have a separate Utility controller that I called with
but now am going to change that
22 Jun 2014 11:08 PM #6
Hi SuperRoo, but the problem is that I can't see how to inherit a controller from Architect.
24 Jun 2014 7:48 AM #7
I think the best approach for sharing controller methods in Architect is to create a Class with those methods, then add it to the mixins of each individual controller.Jason Johnston
Sencha Architect Development Team
25 Jun 2014 10:55 AM #8
@jjonhston - It is one possible approach. Not supporting inheritance is a very big minus for Architect.
1 Apr 2015 6:44 AM #9
Any progress in this
I am having same issue with Sencha Architect. I cannot extend controller from my custom controller.
Please post the workaround if you guys have any.