我正在尝试将2个面板添加到已创建的面板中(layout:stretch,type: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'
},
});
答案 0 :(得分:1)
试试:
datasetInfoPanel.add(variablesAttributesPanel);
datasetInfoPanel.add(locationDatePanel);
从variablesAttributesPanel和locationDatePanel中删除布局。