如何初始化几个叠加层EXT JS对象

时间:2018-12-21 11:13:29

标签: extjs web-applications extjs4 sencha-touch extjs6

我定义了应用程序的主视图,例如“ Ext.panel.Panel”对象。 我们需要将一些面板固定放置在视口上。对于此任务,我使用了叠加方法来定位面板:

//some code of main panel



initialize: function() {if (!this.overlay) {
    this.overlay = Ext.Viewport.add({
        xtype: 'mapWorkSpace', //panel witch rednerTo viewport stationarily
        draggable:'true',
        renderTo: Ext.getBody(),
        fullscreen: true,
        centered: true,
        width: Ext.filterPlatform('ie10') ? '100%' : (Ext.os.deviceType == 'Phone') ? 260 : 400,
        maxHeight: 1254,
        scrollable: false

    });
}

this.overlay.show();
}});

但是,如果我添加更多对象,例如“ mapWorkSpace”之类的面板,则仅第二个叠加层对象会呈现... 所以有一些问题:
1)如何在主视图上同时创建2个或更多叠加对象? 2)这不是在视口中显示对象的最佳方法吗?最好的方法是什么?

0 个答案:

没有答案