ExtJS 4 将网格的高度拉伸到父组件
ExtJS 4 Stretch height of the grid to parent component
我正在尝试将 xtype: 'grid1'
的高度拉伸到其父元素(选项卡面板上的选项卡)。
这是我的代码:
Ext.define('My.view.Example', {
extend: 'Ext.tab.Panel',
region: 'center',
id: 'objectsManageArea',
items: [{
title: "Tab 1",
items: [
{
border: false,
items: [
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch'
},
border: false,
items: [
{
xtype: 'grid1',
flex: 1
}
]
}
]
}
]
},
{
title: "Tab 2",
items: [
{
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
border: false,
items: [
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch'
},
flex: 1,
border: false,
items: [
{
xtype: 'grid2',
flex: 1
}
]
},
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch',
pack: 'center'
},
items: [
{
xtype: 'button',
iconCls: 'icon-greater-than',
margin: '0 5 5 5'
},
{
xtype: 'button',
iconCls: 'icon-less-than',
margin: '0 5 0 5'
}
]
},
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch'
},
flex: 1,
border: false,
items: [
{
xtype: 'treegrid1',
flex: 1
}
]
}
]
}
]
}]
});
在 'Tab 2' 上(带有网格、带有两个按钮的面板和树形网格)一切正常,但在 'Tab 1' 上,嵌套的 xtype: 'grid1'
设置为其内容的高度。我用 vbox 尝试了各种版本,但没有任何效果。可能是什么问题?
我正在尝试将 xtype: 'grid1'
的高度拉伸到其父元素(选项卡面板上的选项卡)。
这是我的代码:
Ext.define('My.view.Example', {
extend: 'Ext.tab.Panel',
region: 'center',
id: 'objectsManageArea',
items: [{
title: "Tab 1",
items: [
{
border: false,
items: [
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch'
},
border: false,
items: [
{
xtype: 'grid1',
flex: 1
}
]
}
]
}
]
},
{
title: "Tab 2",
items: [
{
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
border: false,
items: [
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch'
},
flex: 1,
border: false,
items: [
{
xtype: 'grid2',
flex: 1
}
]
},
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch',
pack: 'center'
},
items: [
{
xtype: 'button',
iconCls: 'icon-greater-than',
margin: '0 5 5 5'
},
{
xtype: 'button',
iconCls: 'icon-less-than',
margin: '0 5 0 5'
}
]
},
{
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch'
},
flex: 1,
border: false,
items: [
{
xtype: 'treegrid1',
flex: 1
}
]
}
]
}
]
}]
});
在 'Tab 2' 上(带有网格、带有两个按钮的面板和树形网格)一切正常,但在 'Tab 1' 上,嵌套的 xtype: 'grid1'
设置为其内容的高度。我用 vbox 尝试了各种版本,但没有任何效果。可能是什么问题?