Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使中心面板展开以在extjs边框布局中占据全部可用空间?_Javascript_Html_Extjs_Height_Width - Fatal编程技术网

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'
            }
            ]
  });
});