Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS open window with max height

Tags:

window

extjs

I am trying to open a window (Ext.Window) by clicking on a button (Ext.Button). The problem is that this window must have size 80% width and 100% height of the screen of the user, that is it should cover all the vertical space.

I am really not able to create a working example. The button I use is hiding/showing this window, which always has wrong size..

Can anyone help me?

Thanks

like image 972
Danilo Avatar asked Jan 18 '11 17:01

Danilo


1 Answers

You are looking for Ext.getBody().getViewSize(). More Specifically, Ext.getBody().getViewSize().height and Ext.getBody().getViewSize().width

This should work in your button's handler -

new Ext.Window({
    title:'Hello World Window',
    html:'Am I the right size?',
    height:Ext.getBody().getViewSize().height,
    width:Ext.getBody().getViewSize().width*0.8 //80%
}).show();
like image 59
Amol Katdare Avatar answered Nov 03 '22 20:11

Amol Katdare