Accordion

The dxAccordion widget contains several panels displayed one under another. These panels can be collapsed or expanded by an end user, which makes this widget very useful for presenting information in a limited amount of space.

Included in: dx.webappjs.js, dx.all.js
Accordion interactive configuration
Copy Code
Copy to Codepen
$("#accordion").dxAccordion({
});

You can create the widget using one of the following approaches.

  • jQuery
    Use the dxAccordion jQuery plug-in.

    HTML
    <div id="accordion"></div>
    JavaScript
    $("#accordion").dxAccordion({
        dataSource: accordionData,
        collapsible: true,
        multiple: true
    });
  • Knockout
    Add a div element and apply the dxAccordion binding to this element.

    HTML
    <div data-bind="dxAccordion: {
        dataSource: accordionData,
        collapsible: true,
        multiple: true
    }"></div>
  • AngularJS
    Add a div element and apply the dx-accordion directive to this element.

    HTML
    <div dx-accordion="{
        dataSource: accordionData,
        collapsible: true,
        multiple: true
    }"></div>

Note that DevExtreme widgets require you to link the jQuery and Globalize libraries to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

Since the dxAccordion widget is used to display multiple items, it supports common Collection Container widget functionality. You can find the detailed information on principles of working with the widget in the dxAccordion section of the Collection Container Widgets article.

View Demo

Watch Video

Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the dxAccordion widget.

Methods

This section describes members used to manipulate the dxAccordion widget.

Events

This section describes events fired by this widget.

Default Item Template

This section lists the data source fields that are used in a default template for dxAccordion items.

By default, a predefined item template is applied to display the items of this widget. This template is based on certain fields of the data source provided for this widget. Below is a list of these fields. If the default item template is not appropriate for your task, implement a custom item template based on these or other fields of your data source.

See Also