PDA

View Full Version : Calling Views



sujithes
13 Apr 2014, 5:02 PM
Hi All,

I'm new to ExtJS.
In my application I do have 3 views. I'm changing the Views to a Viewport
using the following lines of code.

Ext.getCmp('myViewport').removeAll();
Ext.getCmp('myViewport').add(Ext.create('MyProject.view.Dashboard'));
Ext.getCmp('myViewport').doLayout();

Is this the actual way of displaying view to a Viewport?
Also I'm confused if the last line of code[Ext.getCmp('myViewport').doLayout();] is actually required?

Please help.

mdnaveed42
15 Apr 2014, 11:18 PM
Yes, you are right. Just remove the doLayout() line as ExtJs does it internally.

Reference: doLayout()

T (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.container.AbstractContainer-method-doLayout)hanks,
Md Naveed
\m/