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
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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With