DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React List - Grouped List

The List component can display items as a two-level hierarchy: parent and child items. To group items, set the grouped property to true and ensure the data source defines the hierarchy in one of the following ways.

To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
Backend API

Hierarchical Data Source Structure

You can use a dataSource where each entry is an object that contains the key and items fields. The key field specifies the group header (parent), and the items field holds an array of child items. This demo shows how to use this type of data source.

A data source can specify different field names if the data is structured in the same way. In this case, implement the DataSource's map function to create key and items field mappings. Refer to the following help topic for more information: Item Mapping.

Grouping Field

The data source can contain a plain list of objects with multiple fields. Assign a field to the DataSource's group property to create a hierarchical display. Parent items display unique values from the specified field, and Child items display grouped values.

Group Display Settings

If you need to make the groups collapsible, set the collapsibleGroups to true.

You can also use the groupTemplate property to customize the appearance of group headers.