|
|||||||
![]() |
|
|
Thread Tools |
|
#1
|
||||
|
||||
|
Hello and thank you for the great job
I've got a couple of questions which seem very important for me: 1. is there the way to know what Class is the particular object is member of? For example: var viewport = new Ext.Viewport(); console.log(Ext.gimmeClass(viewport)) // i want "Ext.Viewport" here... I like the Viewport component, let it have default layout Ext.layout.ContainerLayout: var viewport = new Ext.Viewport(); Documentation of Viewport and or ContainerLayout tells me absolutely nothing about adding items. I tried viewport.add, viewport.getLayout().add, and etc - it doesnt work |
|
#2
|
||||
|
||||
|
Every ext container (viewport included) have a getEl() method which returns the underlying ext element. See docs for Element.
When you add a component to a container you call its doLayout() method. In your case it is viewport.doLayout() after you add. |
|
#3
|
|||
|
|||
myViewPort.add( myGridPanel ); myViewPort.doLayout(); |
|
#4
|
||||
|
||||
|
Thanks guyz.
I read about Viewport that it automatically redraws everything by itself and had no idea that I need to do it myself )its very pity abt first question |
|
#5
|
||||
|
||||
|
You can use basic JavaScript functions like typeof for determining JS object type. You can also use several methods of Component like isXType, getXType and getXTypes to determine the Ext-specific class types.
|
|
#6
|
|||
|
|||
|
Quote:
I went back and read up on the typeof JavaScript operator, it will only return 'object' according to the docs. |
![]() |
| Thread Tools | |
|
|