1
votes

In my Sencha Touch application, I have a Login Screen which extends 'Ext.form.Panel' and then a MainView which is a navigation view. After authentication is successful from the Login screen I need to show the Main View. I am checking the authentication in the controller and on success I am calling the Main View.

if(success){
    Ext.Viewport.add({xtype:'MyApp.view.MainView'});
}

I tried the following ViewPort options,

animateActiveItem,Ext.Viewport.show(true)

None of them are working.

How can i activate Navigation View from Panel?

Reg,

P

1

1 Answers

0
votes

Use Ext.Viewport.setActiveItem, and use the xtype of your MainView, not the full class name:

Ext.define('MyApp.view.MainView', {
    extend: 'Ext.navigation.View',
    xtype: 'main-view',
    ...
})

...

if(success){
    Ext.Viewport.setActiveItem({xtype:'main-view'});
}