Override defaults with $.fn.accordion.defaults.
Create accordion via markup, add 'easyui-accordion' class to <div/> markup.
We can change or recreate accordion later and modify some features.
Call 'getSelected' method to get the current panel and then we can call 'refresh' method of panel to load new content.
Name | Type | Description | Default |
---|---|---|---|
width | number | The width of accordion container. | auto |
height | number | The height of accordion container. | auto |
fit | boolean | Set to true to set the accordion container size fit it's parent container. | false |
border | boolean | Defines if to show the border. | true |
animate | boolean | Defines if to show animation effect when expand or collapse panel. | true |
The accordion panel options is inhirited from panel, below is the addition properties:
Name | Type | Description | Default |
---|---|---|---|
selected | boolean | Set to true to expand the panel. | false |
Name | Parameters | Description |
---|---|---|
onSelect | title | Fires when a panel is selected. |
onAdd | title | Fires when a new panel is added. |
onBeforeRemove | title | Fires before a panel is removed, return false to cancel the remove action. |
onRemove | title | Fires when a panel is removed. |
Name | Parameter | Description |
---|---|---|
options | none | Return the options of accordion. |
panels | none | Get all panels. |
resize | none | Resize the accordion. |
getSelected | none | Get the selected panel. |
getPanel | title | Get the specified panel. |
select | title | Select the specified panel. |
add | options | Add a new panel. |
remove | title | Remove the specified panel. |