Latest web development tutorials
×

jQuery EasyUI Tutorial

jQuery EasyUI Tutorial jQuery EasyUI Introduction

jEasyUI application

jEasyUI Create a CRUD application jEasyUI Create a CRUD data grid jEasyUI Form CRUD application jEasyUI Create an RSS reader

jEasyUI Drag and drop

jEasyUI Basic drag and drop jEasyUI Create a drag-and-drop shopping cart jEasyUI Create a school curriculum

jEasyUI Menus and buttons

jEasyUI Create a simple menu jEasyUI Create a link button jEasyUI Create a menu button jEasyUI Create a split button

jEasyUI layout

jEasyUI Create a border layout jEasyUI Create a complex layout jEasyUI Creates a fold panel jEasyUI Create a tab page jEasyUI Dynamically add a tab jEasyUI Add the AutoPlay tab jEasyUI Create the XP style left panel

jEasyUI Data grid

jEasyUI Convert HTML tables to data grids jEasyUI Get the selected row data jEasyUI Add the query function jEasyUI Add a toolbar jEasyUI Create complex toolbars jEasyUI Sets the frozen column jEasyUI Dynamically change columns jEasyUI Format the column jEasyUI Set sort jEasyUI Custom sorting jEasyUI Create a column combination jEasyUI Add a check box jEasyUI Custom tab jEasyUI Enable in-line editing jEasyUI Extension editor jEasyUI Column operation jEasyUI Merge Cells jEasyUI Create a custom view jEasyUI Create a footer summary jEasyUI Condition Sets the line background color jEasyUI Create an attribute grid jEasyUI The extended line shows the details jEasyUI Create a subgrid jEasyUI Display massive data jEasyUI Add a paging component

jEasyUI window

jEasyUI Create a simple window jEasyUI Customize the Window Toolbar jEasyUI Window and layout jEasyUI Create a dialog box jEasyUI Customize the dialog box

jEasyUI Tree menu

jEasyUI Use the markup to create a tree menu jEasyUI Create an asynchronous tree menu jEasyUI Tree menu to add nodes jEasyUI Create a tree menu with check boxes jEasyUI Tree menu drag and drop control jEasyUI The Tree menu loads the parent / child nodes jEasyUI Create the base tree grid jEasyUI Create a complex tree grid jEasyUI Dynamic loading of tree jEasyUI The tree grid adds pagination jEasyUI Tree-lazy lazy-loading node

jEasyUI Form

jEasyUI Create an asynchronous submission form jEasyUI Form validation jEasyUI Create a tree drop-down box jEasyUI Format the drop-down box jEasyUI Filter down the data grid

jEasyUI Reference Manual

jQuery EasyUI Plugin jQuery EasyUI Extended

jQuery EasyUI layout widget - Accordion fold panel

jQuery EasyUI plugin jQuery EasyUI plugin

By $ .fn.accordion.defaults override the default defaults.

Folding panel (accordion) allows you to provide a plurality of panels (panel), while one or more display panels (panel). Each panel (panel) has expanded and built-in support collapsed. Click on the panel (panel) of the head to expand or collapse panels (panel) body. Panel (panel) content can be loaded via ajax designated 'href' attribute. User-definable selected panel (panel). If specified, the default is selected the first panel (panel).

rely

  • panel

usage

Create folding panel (Accordion)

Created by marking folding panel (Accordion), add 'easyui-accordion' class to the <div> tag.

<Div id = "aa" class = "easyui-accordion" style = "width: 300px; height: 200px;">
    <Div title = "Title1" data-options = "iconCls: 'icon-save'" style = "overflow: auto; padding: 10px;">
		<H3 style = "color: # 0099FF;"> Accordion for jQuery </ h3>
		<P> Accordion is a part of easyui framework for jQuery.
		It lets you define your accordion component on web page more easily. </ P>
    </ Div>
    <Div title = "Title2" data-options = "iconCls: 'icon-reload', selected: true" style = "padding: 10px;">
		content2
    </ Div>
    <Div title = "Title3">
		content3
    </ Div>
</ Div>

We can change or re-folding panels (Accordion), the modification of certain properties.

$ ( '# Aa'). Accordion ({
    animate: false
});

Refresh folding panel (Accordion Panel) content

Call 'getSelected' method to get the current panel (panel), then we can call the panel (panel) of the 'refresh' method to load new content.

var pp = $ ( '# aa') accordion ( 'getSelected');. // get the selected panel (panel)
if (pp) {
    pp.panel ( 'refresh', 'new_content.php'); // call 'refresh' method to load new content}

Container Options

名称 类型 描述 默认值
width number 折叠面板(Accordion)容器的宽度。 auto
height number 折叠面板(Accordion)容器的高度。 auto
fit boolean 设置为 true,就使折叠面板(Accordion)容器的尺寸适应它的父容器。 false
border boolean 定义是否显示边框。 true
animate boolean 定义当展开或折叠面板(panel)时是否显示动画效果。 true
multiple boolean 设置为 true,则可同时展开多个面板(panel)。该属性自版本 1.3.5 起可用。 false
selected number 初始化选中的面板(panel)索引。该属性自版本 1.3.5 起可用。 0

Panel (Panel) option

Folding panel (Accordion) panel (panel) options are inherited from the panel (panel), the following are additional attributes:

名称 类型 描述 默认值
selected boolean 设置为 true 就展开面板(panel)。 false
collapsible boolean 定义是否显示可折叠按钮。如果设置为 false,将不能通过点击来展开/折叠面板(panel)。 true

event

名称 参数 描述
onSelect title,index 当面板(panel)被选中时触发。
onUnselect title,index 当面板(panel)未被选中时触发。该事件自版本 1.3.5 起可用。
onAdd title,index 当添加一个新面板(panel)时触发。
onBeforeRemove title,index 当移除一个面板(panel)之前触发,返回 false 就取消移除动作。
onRemove title,index 当移除一个面板(panel)时触发。

method

名称 参数 描述
options none 返回折叠面板(accordion)的选项。
panels none 获取全部的面板(panel)。
resize none 调整折叠面板(accordion)的尺寸。
getSelected none 获取第一个选中的面板(panel)。
getSelections none 过去所有选中的面板(panel)。该方法自版本 1.3.5 起可用。
getPanel which 获取指定的面板(panel)。'which' 参数可以是面板(panel)的标题(title)或索引(index)。
getPanelIndex panel 获取指定的面板(panel)索引。该方法自版本 1.3 起可用。
下面的实例显示如何获取选中的面板(panel)索引。
var p = $('#aa').accordion('getSelected');
if (p){
	var index = $('#aa').accordion('getPanelIndex', p);
	alert(index);
}
select which 选择指定的面板(panel)。'which' 参数可以是面板(panel)的标题(title)或索引(index)。
unselect which 未选择指定的面板(panel)。'which' 参数可以是面板(panel)的标题(title)或索引(index)。该方法自版本 1.3.5 起可用。
add options 添加一个新的面板(panel)。默认情况下,新添加的面板(panel)会被选中。如需添加一个未被选中的新面板(panel),请传递 'selected' 属性,并将其设置为 false。
代码实例:
$('#aa').accordion('add', {
	title: 'New Title',
	content: 'New Content',
	selected: false
});
remove which 移除指定的面板(panel)。'which' 参数可以是面板(panel)的标题(title)或索引(index)。

jQuery EasyUI plugin jQuery EasyUI plugin