Javascript 如何使中心面板展开以在extjs边框布局中占据全部可用空间?
我有以下资料:Javascript 如何使中心面板展开以在extjs边框布局中占据全部可用空间?,javascript,html,extjs,height,width,Javascript,Html,Extjs,Height,Width,我有以下资料: 如何在不显式设置宽度和高度的情况下,使中间的面板扩展到可用宽度和高度?如果不显式定义宽度,它将自动采用可用宽度,但必须显式定义高度。以下是设置面板可用高度的变通方法 Ext.onReady(function(){ Ext.create('Ext.panel.Panel', { renderTo:'myDiv', html: '<div style="background-color: blue;"></div>',
如何在不显式设置宽度和高度的情况下,使中间的面板扩展到可用宽度和高度?如果不显式定义宽度,它将自动采用可用宽度,但必须显式定义高度。以下是设置面板可用高度的变通方法
Ext.onReady(function(){
Ext.create('Ext.panel.Panel', {
renderTo:'myDiv',
html: '<div style="background-color: blue;"></div>',
//width: 500,
height: (document.body || document.documentElement).scrollHeight,
border: 'layout',
items: [
{
xtype: 'button',
text: 'Test Button',
region: 'north'
},{
xtype: 'panel',
html: '<div style="background-color: red; "></div>',
region: 'center'
}
]
});
});
如果要将高度设置为等于任何元素,则可以使用Ext.get'divid'。getHeight使用布局:“border”而不是border:@CD这是使用box而不是panel。面板:
Ext.onReady(function(){
Ext.create('Ext.panel.Panel', {
renderTo:'myDiv',
html: '<div style="background-color: blue;"></div>',
//width: 500,
height: (document.body || document.documentElement).scrollHeight,
border: 'layout',
items: [
{
xtype: 'button',
text: 'Test Button',
region: 'north'
},{
xtype: 'panel',
html: '<div style="background-color: red; "></div>',
region: 'center'
}
]
});
});