ExtJS打开窗口,最大高度 [英] ExtJS open window with max height

查看:119
本文介绍了ExtJS打开窗口,最大高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过点击一个按钮(Ext.Button)打开一个窗口(Ext.Window)。问题是这个窗口必须具有80%的宽度和100%用户屏幕的高度,就是它应该覆盖所有的垂直空间。

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..

有人可以帮助我吗?

谢谢

推荐答案

您正在寻找 Ext.getBody()。getViewSize() EM> 即可。更具体地说,Ext.getBody()。getViewSize()。height和Ext.getBody()。getViewSize()。width

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

这应该在你的按钮的处理程序中工作 - / p>

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();

这篇关于ExtJS打开窗口,最大高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆