I have the following code in my controller and am trying to simply switch a view.
Can anyone explain how to get the view to display.
Ext.define('MyApp.controller.HomeController', {
extend: 'Ext.app.Controller',
config: {
views: [
'Home',
'ChangeEmailView'
],
refs: {
changeEmailView: {
selector: '#btnChangeEmail',
xtype: 'ChangeEmailView'
}
}
},
init: function(application) {
alert("init");
},
launch: function() {
alert("launch");
}
});
View:
Ext.define('MyApp.view.ChangeEmailView', {
extend: 'Ext.Panel',
alias: 'widget.ChangeEmailView',
config: {
items: [{
xtype: 'toolbar',
docked: 'top',
ui: 'light',
title: 'Change Email Address'
}]
}
});
The simplest way would be the following:
Here’s an example
But then it really depends of your app structure. Maybe you’re working with a NavigationView and then you need to push the view.
Hope this helped