-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Accordion
The Accordion component contains several panels displayed one under another. Users can expand or collapse these panels, which makes this component useful to present information in a limited amount of space.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
<div id="accordion">
@(Html.DevExtreme().Accordion()
.ID("accordion-container")
.DataSource(d => d.Mvc().LoadAction("GetData").Key("ID"))
.AnimationDuration(300)
.Collapsible(false)
.Multiple(false)
.OnSelectionChanged("accordion_selectionChanged")
.ItemTitleTemplate(@<text><div class="header"><%- Name %></div></text>)
.ItemTemplate(@<text>
<div class="accodion-item">
<div>
<p>
<b><%- City %></b>
(<span><%- State %></span>)
</p>
<p>
<span><%- ZipCode %></span>
<span><%- Address %></span>
</p>
</div>
<div>
<p>Phone: <b><%- Phone %></b></p>
<p>Fax: <b><%- Fax %></b></p>
<p>Website: <a href="<%- Website %>" target="_blank"><%- Website %></a></p>
</div>
</div>
</text>)
)
<div class="options">
<div class="caption">Options</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Text("Multiple enabled")
.OnValueChanged("multipleMode_changed")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Text("Collapsible enabled")
.OnValueChanged("collapsibleMode_changed")
)
</div>
<div class="option">
<span>Animation duration</span>
@(Html.DevExtreme().Slider()
.Min(0)
.Max(1000)
.Value(300)
.Label(l => l.Visible(true))
.Tooltip(t => t
.Enabled(true)
.Position(VerticalEdge.Bottom)
)
.OnValueChanged("slider_valueChanged")
)
</div>
<div class="option">
<span class="caption">Selected Items</span>
@(Html.DevExtreme().TagBox()
.ID("tagbox")
.DisplayExpr("Name")
.ValueExpr("ID")
.InputAttr("aria-label", "Company")
.Value(new[] { 1 })
.DataSource(d => d.Mvc().LoadAction("GetData").Key("ID"))
.Disabled(true)
.OnValueChanged("tagBox_valueChanged")
)
</div>
</div>
<script>
function getAccordionInstance() {
return $("#accordion-container").dxAccordion("instance");
}
function getTagBoxInstance() {
return $("#tagbox").dxTagBox("instance");
}
function tagBox_valueChanged(e) {
getAccordionInstance().option("selectedItemKeys", e.value);
}
function accordion_selectionChanged(e) {
getTagBoxInstance().option("value", e.component.option("selectedItemKeys"));
}
function slider_valueChanged(e) {
getAccordionInstance().option("animationDuration", e.value);
}
function multipleMode_changed(e) {
var tagBox = getTagBoxInstance(),
accordion = getAccordionInstance();
accordion.option("multiple", e.value);
tagBox.option("disabled", !e.value);
tagBox.option("value", accordion.option("selectedItemKeys"));
}
function collapsibleMode_changed(e) {
getAccordionInstance().option("collapsible", e.value);
}
</script>
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
Bind Accordion to Data
You can display Accordion items from the items array or a dataSource. If you use the items array, specify the title and text properties.
Configure Item Selection and Collapsibility
Enable the multiple property to allow users to select multiple panels. Use the selectedItems array to store selected items. Toggle the "Multiple enabled" checkbox in the Options demo section to see how it affects the selection.
If you want to allow users to close panels on click, set the collapsible property to true. Check the "Collapsible enabled" checkbox in the Options demo section to enable this feature.
Configure Animation
The animationDuration property allows you to specify the animation duration when users expand/collapse a panel. Use the "Animation duration" slider in the Options demo section to see how it affects the animation.
Customize Item Appearance
Use the itemTemplate and itemTitleTemplate properties to customize the panel appearance. If you use the items array, you can also specify the icon property.