How to set height of window from TOP position or How to change the position of window when I perform maximize operation
第1步:Extjs中有一个窗口。
第2步:打开的窗口具有一定的高度和宽度。
步骤3:我单击最大化按钮,窗口将最大化,但是我不希望窗口覆盖整个屏幕。在顶部,我有一个工具栏。
步骤4:通过最大化工具栏也将重叠的窗口。
所以,当我最大化窗口工具栏时应该有办法保持不重叠
您可以通过使用
1 2 3 4 5 6 7 8 9 10 | tools: [{ type: 'maximize', handler: function (evt, toolEl, owner, tool) { var toolbarHeight = Ext.ComponentQuery.query('toolbar')[1].getHeight(); //getting height of the toolbar var window = owner.up('window'); window.maximize( ); window.setPosition(0, toolbarHeight); window.setHeight(window.getHeight()-toolbarHeight); } }] |
工作示例