我有以下Ext.TabPanel:如何获得Ext.Panel的高度,以填补父区域
var modules_info_panel = new Ext.TabPanel({
activeTab: 0,
defaults:{autoScroll:true},
//layout: 'fit', // makes component disappear
viewConfig: {
forceFit: true //has no effect
},
// height: auto, //error "auto isn't recognized"
items:[{
title: 'Section 1',
html: 'test'
},{
title: 'Section 2',
html: 'test'
},{
title: 'Section 3',
html: 'test'
}]
});
,看起来像这样:
我如何获得中间的线向下延伸至底部,以便垂直填充其父空间?
这里的的TabPanel是如何加载到regionContent
:
regionContent = new Ext.Panel({
id: 'contentArea',
region: 'center',
autoScroll: true
});
function clearExtjsComponent(cmp) {
var f;
while(f = cmp.items.first()){
cmp.remove(f, true);
}
}
function replaceComponentContent(cmpParent, cmpContent) {
clearExtjsComponent(cmpParent);
cmpParent.add(cmpContent);
cmpParent.doLayout();
}
replaceComponentContent(regionContent, modules_info_panel);
我看到的高度是在DOM这个元素绝对(19px),其中是被设置?
附录
McStretch,我想你的想法通过把layout: 'fit'
在标签本身,而是该行仍然是在同一个地方:
var modules_info_panel = new Ext.TabPanel({
activeTab: 0,
defaults:{autoScroll:true},
items:[{
title: 'Section 1',
layout: 'fit',
html: 'test'
},{
title: 'Section 2',
layout: 'fit',
html: 'test'
},{
title: 'Section 3',
layout: 'fit',
html: 'test'
}]
});
对此深感抱歉,我更新了我与布局的正确位置的响应:“适应” – McStretch 2010-12-02 15:25:05