I just realized that alternate class names for controllers in ExtJS 4.2.1 don't work the way I expected them to:
Ext.define('AppName.controller.subnamespace.Controller1', {
extend: 'Ext.app.Controller',
alternateClassName: 'AppName.Ctrl1',
// ...
});
Accessing the controller with the getController method of the app (or any controller) works for both names (the long one & the alternate one) but returns 2 distinct instances of the controller:
var ctrlInstance1 = AppName.app.getController('AppName.controller.subnamespace.Controller1'),
ctrlInstance2 = AppName.app.getController('AppName.Ctrl1');
console.log(ctrlInstance1 === ctrlInstance2); // --> false
Is this intended behavior or a bug? If its a bug I'm going to file a bug report...
Thanks
Ps.: I've also asked this question in the official sencha forums but didn't get no response so far: http://www.sencha.com/forum/showthread.php?271970-Alternate-class-name-in-controller