PDA

View Full Version : [CLOSED] The router doesn't work when the controler is set in the route



xxxpinoxxx
25 Apr 2014, 2:17 AM
Ext.define('Fiddle.controller.Root', {
extend : 'Ext.app.Controller',

list: function() {
console.log('root.list');
}
});

Ext.define('Fiddle.controller.User', {
extend : 'Ext.app.Controller',

config : {
routes : {
'users' : {
action: 'list',
controller: 'Root' //! I can't launch a Root controler action
}
}
}
});

Ext.application({
name : 'Fiddle',

controllers: [
'Root',
'User'
],

launch : function() {

}
});

mitchellsimoens
25 Apr 2014, 4:13 AM
That's because that use is not documented anywhere and not designed to work like that. The route will only execute the action within the controller it's defined so you would need to define the users route in the Root controller.