PDA

View Full Version : win height according to the screen height



same66
27 Jan 2011, 2:35 AM
Hi,

I'm using a virtual desktop and I want to limit the win height.
If the user screen height is 800 => the win in my desktop max height is 800
If the user screen height is 1000 => the win in my desktop max height is 1000
If...

I want the windows do not exceed the screen height.

In my code, if my windows is more "height ? (sorry french)" than the desktop I get the desktop height and I set this height in my windows.

But my code isn't optimized...

Do you know a method to do that ?
ExtJS allows it natively ?

Thanks :)

Barzoy
27 Jan 2011, 4:24 AM
Try a combination if Ext.Viewport and Ext.Window


new Ext.Viewport({
layout: 'fit',
items: [
new Ext.Window({
title: 'Test',
constrain: true,
maximizable: true,
minimizable: true,
resizable: true,
draggable: true,
hidden: false,
width: 400,
height: 300
})
]
});