sencha touch switch views

508 Views Asked by At

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 ???

1

There are 1 best solutions below

1
On BEST ANSWER

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();