PDA

View Full Version : Ext.Window: Bug or wrong usage



cboettch
20 Oct 2009, 2:59 AM
When I want to open a new window, and I define it as a variable like


var win = new Ext.window({someParameters});
win.show();
everything works fine.
If I define it as a item of the Viewport and access it via its id like


Ext.getCmp('windowId').show();only the background shadow is displayed. The window itself is rendered but has a visibility:hidden style.
Is this a bug, or is the window not intended to be defined in the items section?

Carsten

jay@moduscreate.com
20 Oct 2009, 3:58 AM
I have not seen this problem. Has the window been destroyed prior?

cboettch
20 Oct 2009, 4:08 AM
I have not seen this problem. Has the window been destroyed prior?

No! The effect appears on the first show() call. The definition looks something like that:


var viewport = new Ext.Viewport({
...
items:[
{...},
{...},
new Ext.Window({...})
]
})Carsten

jay@moduscreate.com
20 Oct 2009, 4:19 AM
Why is the window a child of the viewport? it should not be.

cboettch
20 Oct 2009, 4:34 AM
Why is the window a child of the viewport? it should not be.

OK, that's what I want to know. It would have some advantages for our project, if a window could be defined as a item of the viewport. And it nearly seems to work, we had only to add one style.
But we can also define the window as a separate element...

Thanks
Carsten

jay@moduscreate.com
20 Oct 2009, 4:41 AM
i don't get the 'advantage(s)' at all.

cboettch
20 Oct 2009, 5:03 AM
i don't get the 'advantage(s)' at all.

It would take a bit longer to explain the advantages. Mainly it's because we describe the components in XML, which will be compiled to JS. If the window could be defined in the viewport, it would save some JS in our case.

Carsten

jay@moduscreate.com
20 Oct 2009, 5:05 AM
I see. Generally a "child" of a container is mean to take part in some sort of layout.

Windows, in this case, do not.

Does that make sense?