Code:
control: {
'login #signup': {
tap: function(btn, e) {
//switch view via routing
this.redirectTo('index/register');
e.event && e.stopEvent();
}
}
},
routes: {
'index/:view': 'switchView'
}
then this is the switchView() function:
Code:
switchView: function(view) {
//avoid setActiveItem from creating a new view
var targetView = Ext.ComponentQuery.query(view)[0];
//checks availability of the view
if (targetView === undefined) {
var device = (Ext.os.is.Phone ? 'phone' : 'tablet');
targetView = Ext.create('SenchaCordova.view.' + device + '.' + Ext.String.capitalize(view)); //create the view
}
//animate to view
Ext.Viewport.animateActiveItem(targetView, { type : 'slide', direction : 'left' } );
}