Accordion布局有类Ext.layout.Accordion定义,名称为accordion, 表示可折叠的布局,也就是说使用该布局的容器组件中的子元素是可折叠的形式。
Ext.onReady(function(){
new Ext.Panel({
renderTo: "hello",
title: "容器组件",
width: 500,
height: 200,
layoutConfig:{
animate: true
},
items: [{title: "子元素1", html: "这是子元素1中的内容"},
{title: "子元素2", html: "这是子元素2中的内容"},
{title: "子元素3", html: "这是子元素3中的内容"}
]}
);
});
该容器组件中包含三个子元素,在layoutConfig中指定布局的配置参数是animate: true,表示在执行折叠时是否使用动画效果。