具有手风琴布局的面板与另一个项目一起包含在 vbox 中。
我有两个烦恼:
- 当我尝试使用手风琴布局将 flex 设置为面板时,会导致错误“[E] 布局运行失败”
- 当通过 constand 固定高度时,它不会按预期工作:第一个面板不会折叠。
这是代码示例:
Ext.create('Ext.panel.Panel', {
title: 'Accordion Layout',
width: 300,
height: 500,
layout: 'vbox',
items: [{
xtype: 'datefield'
}, {
defaults: {
// applied to each contained panel
bodyStyle: 'padding:15px'
},
layout: {
// layout-specific configs go here
type: 'accordion',
titleCollapse: true,
animate: true
},
items: [{
title: 'Panel 1',
html: 'Panel content 1!'
}, {
title: 'Panel 2',
html: 'Panel content 2!'
}, {
title: 'Panel 3',
html: 'Panel content 3!'
}],
}],
renderTo: Ext.getBody()
});