PDA

View Full Version : Can a controller extend another controller?



estesbubba
6 Oct 2011, 6:51 AM
I have 2 applications that use 95% identical functionality for a controller. I want to have a BaseController which AController and BController both extend. I've done this in Ext JS 4 but can't figure a way to do it using Touch. Any ideas?

estesbubba
6 Oct 2011, 7:56 AM
Don't know if this is the best solution but it works



Ext.ControllerManager.registerController = function(obj) {

var controller = new obj;
controller.application = Ext.ApplicationManager.currentApplication;
if (controller.init) {
controller.init();
}
this.all.add(controller);

return controller;
}
...
BaseWorkflowController = Ext.extend(Ext.Controller, {...});
...
DsxController = Ext.extend(BaseWorkflowController, {...});
...
Ext.ControllerManager.registerController(DsxController);