Riz
Riz

Reputation: 741

sencha touch switch views

I am using following method to switch between views:

Ext.Viewport.remove(Ext.Viewport.getActiveItem(), true);
Ext.Viewport.add(Ext.create('pulse.view.HomePage'));

Is this finest way to do or is there any better way to switch views, because using this code, I am experiencing delay in switching screens.

Is there any way to find out if view is already create by Ext.create or not ???

Upvotes: 1

Views: 492

Answers (1)

Bogdan Dumitriu
Bogdan Dumitriu

Reputation: 51

Try to use show() and hide instead of remove() - add(). Ext.getCmp('yourComponentsId').hide();

If it's a dynamic component such as a list, use refresh(). Ext.getCmp("YOUR_COMPONENTS_ID").refresh();

Upvotes: 1

Related Questions