My app follow the below navigation
Home View -> Login View -> Campaign View
When a user tap on home view it redirects user to login view with below code
Code:
var loginstep = Ext.create('Myapp.view.Login');
Ext.Viewport.setActiveItem(loginstep);
When a user tap submit login form on Login view than it redirects user to campaign view with below code
Code:
success: function(response) {
if(response.MESSAGE == 'success') {
Ext.Viewport.setMasked(false);
var firststep = Ext.create('Myapp.view.Campaignlist');
Ext.Viewport.setActiveItem(firststep);
}
}
Now i had a logout button on campaign view. I want when a user tap on it, user must go to home screen and agin the process should be continue.
For logout i had make a button with below code
Code:
{
xtype: 'button',
docked: 'bottom',
ui: 'decline',
style: 'border-radius:0',
text: 'Logout',
action: 'logoutuser'
}
Also make a function for logoutuser action in controller
Code:
logout: function() {
Ext.Msg.confirm("Confirmation.....",
"Are you sure you want to logout?",
function ( answer ) {
if(answer == 'yes') {
var loginstep1 = Ext.create('Myapp.view.Home');
Ext.Viewport.animateActiveItem(loginstep1, {type: 'slide', direction: 'right'});
//Ext.Viewport.add(loginstep1); Also tried this code
//Ext.Viewport.setActiveItem(loginstep1);
}
});
}
Using above codes user redirecting to home view but when i tried to again go to login view than the app break and nothing happened.