Accordion

A widget that displays data source items on collapsible panels.

Included in: dx.webappjs.js, dx.all.js

The dxAccordion widget displays items one under another and enables an end-user to collapse and expand these items. A displayed item consists of a body and a title. If an item is collapsed, the widget displays only its title.

You can create a 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>
  • Angular
    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 Angular approach, the Knockout or Angular library is also required.

See Also

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 exposed by the dxAccordion 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