1,介绍
分类控件允许用户使用多面板,但在同一时间只会显示一个。每个面板都支持展开和折叠功能
点击面板的标题 将会展开或折叠面板主体
继承关系 panel
2,属性
属性名 | 属性值类型 | 描述 |
width | number | 宽度 |
height | number | 高度 |
border | boolean | 定义是否显示门户边框 |
fit | boolean | 当该属性为true 设置门户大小自适应父容器 |
selected | number | 设置初始化时默认选中的面板索引号 (索引从0开始) |
3,方法
方法名 | 参数类型 | 描述 |
panels | none | 获取所有面板 |
getSelected | none | 获取选中的面板 |
4,实例
<div id="accordionNew" class="easyui-accordion" style="width:300px;height:200px;" data-options="selected:0">
<div title="T1" data-options="iconCls:'icon-save'" style="overflow:auto;padding:10px">1</div>
<div title="T2" data-options="iconCls:'icon-save'" style="overflow:auto;padding:10px">2</div>
<div title="T3" data-options="iconCls:'icon-save'" style="overflow:auto;padding:10px">3</div>
</div>
$(function () {
$("#accordionNew").accordion({
onSelect: function (title, index) {
console.info(title + " " + index);
var pp = $(this).accordion("getSelected");
if (title=="T2") {
pp.panel('refresh', 'T5-1.html');//调用refresh 刷新
}
}
});
});