I'm dynamically loading a new Route Controller and initializing it. It works fine and the new routes take effect.
However, it looks like the old route controller is still loaded as well.
In both controllers there is the following listener for unmatched route and all of them execute.
listen : {
controller : {
'#' : {
unmatchedroute : 'onUnmatchedRoute'
}
}
},
How can the route controller be replace with another one dynamically?
Do not use listen : { controller: { '#': { unmatchedroute
Use on and un:
// addListener
MyApp.app.on('unmatchedroute', someFunction);
//or
Ext.on('unmatchedroute', someFunction);
// removeListener
MyApp.app.un('unmatchedroute', someFunction);
//or
Ext.un('unmatchedroute', someFunction);