ExtJS 4桌面模块窗口在打开时拉伸停止/任务栏,其大小/位置使其超过桌面大小



如果我在一个模块上调用createWindow并给它width, height, xy值,窗口将打开良好,但使桌面和/或任务栏看起来拉长。

例如,如果打开了一个窗口,其底部边框在任务栏下方,它不仅会覆盖任务栏,还会继续向下移动整个边框,使顶部消失,并且任务栏将一直延伸到表单的底部。

理想情况下,我希望窗口的重叠部分滑出屏幕并在任务栏下。

Ext.define('MyApp.view.locations.Module', {
.......
createWindow:        function (width, height, x, y) {
    this.width  = width  || 740;
    this.height = height || 480;
    var b = this.app.getDesktop();
    var a = b.getWindow('locations-module-window');
    if (!a) {
        this.locationsGrid   = Ext.create('MyApp.view.locations.Grid');
        this.locationsFilter = Ext.create('MyApp.view.locations.Filter');
        this.locationsPanel = Ext.create('Ext.form.Panel', {
            bodyPadding:       0,
            border:            true,
            fieldDefaults:     {
                labelAlign:   'left',
                msgTarget:    'side'
            },
            frame:             false,
            header:            false,
            id:               'locations-module-panel',
            layout:           'border',
            defaults:          {
                bodyStyle:    'padding: 15px',
                collapsible:   true,
                split:         true
            },
            items:             [
                this.locationsGrid,
                this.locationsFilter
            ]
        });
        a = b.createWindow({
            animCollapse:      true,
            border:            false,
            collapsible:       true,
            constrainHeader:   false,
            height:            this.height,
            width:             this.width,
            x:                 x,
            y:                 y,
            iconCls:          'icon-locations',
            id:               'locations-module-window',
            layout:           'fit',
            maximizable:       true,
            minimizable:       true,
            title:            'Locations',
            items:             [{
                activeTab:     0,
                defaults:      {
                    border:    false,
                    header:    false
                },
                xtype:        'tabpanel',
                items:         [{
                    iconCls:  'icon-locations',
                    layout:   'fit',
                    title:    'Branches',
                    items:     this.locationsPanel
                },{
                    html:     "<p>Region items go here.</p>",
                    iconCls:  'icon-regions',
                    title:    "Regions"
                }]
            }]
        });
    };
    a.show();
    return a
},
....

查看Ext.window.Window文档中的注释:

默认情况下,Windows将呈现为document.body。要将窗口约束到另一个元素,请指定renderTo.

因此,将renderTo设置为包含所有窗口的任何面板。大概这个面板没有重叠在"任务栏"上,所以窗口也不会重叠。

最新更新