簡體   English   中英

ExtJS將面板添加到面板

[英]ExtJS add panel to panel

我正在嘗試將2個面板添加到已創建的面板中(布局:拉伸,鍵入:hbox)。 我在螢火蟲中沒有任何錯誤,但屏幕上似乎沒有任何反應。

這是將2個面板添加到已定義面板的代碼。

var variablesAttributesPanel = new Ext.Panel({
    id: 'variablesAttributesPanel',
    title: 'variablesAttributesPanel',
    autoScroll: true, 
    html: 'yeah1',
    layout: {
        align: 'stretch',
        type: 'vbox'
    },
    flex: 1
});
var locationDatePanel = new Ext.Panel({
    id: 'locationDatePanel',
    autoScroll: true, 
    title: 'locationDatePanel',
    html: 'yeah2',
    layout: {
        align: 'stretch',
        type: 'vbox'
    },
    flex: 1
});
Ext.getCmp('datasetInfoPanel').add(variablesAttributesPanel);
Ext.getCmp('datasetInfoPanel').add(locationDatePanel);
Ext.getCmp('datasetInfoPanel').update();
Ext.getCmp('datasetInfoPanel').doLayout();

關於我在做什么錯的任何想法嗎?

編輯

var datasetInfoPanel = new Ext.Panel({
    id: 'datasetInfoPanel',
    title: "Dataset Information", 
    region: "center", 
    autoScroll: true, 
    layout: {
        align: 'stretch',
        type: 'hbox'
    },
}); 

嘗試:

datasetInfoPanel.add(variablesAttributesPanel);
datasetInfoPanel.add(locationDatePanel);

從variablesAttributesPanel和locationDatePanel移除布局confing。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM