SYIDAX / DATA GRID

Multi-level headers

Group related columns beneath a shared parent header.

Get started
Multi-level headersSample order data
120 rows
Loading Grid…
Latest result

For example, group product and quantity under Order details. The current preview has a single header; add the group to your app's column definitions.

View code
Current preview

Usage guide

#

Use a shared heading for related columns such as delivery country, city, and address. Parent and individual headings appear across two or more rows.

Integration steps

  1. Choose columns to group

    For example, group product and quantity under Order details. The current preview has a single header; add the group to your app's column definitions.

  2. Create a parent heading

    Add a columnDefs entry with headerName set to Order details and place product and quantity columns in its children array.

  3. Inspect the expanded result

    Pass the new columnDefs array to the Grid. Product and quantity appear beneath the parent heading, with sorting and resizing available on each column.

Expected results

Multi-level headers make related columns easier to identify. Source row data does not need to change shape.

Distinguish a parent group's name from the columns that read actual data. The product column's field remains product.

Useful terms

children
The child columns contained within a parent header.
groupId
A unique name identifying a header group.

Key API examples

Application code that references the registered Grid element as grid.

grid.columnDefs = [{ headerName: 'Order', groupId: 'order', children: [
  {field:'product', headerName:'Product'},
  {field:'quantity', headerName:'Quantity'}
]}];

API reference

#

Events1
EventsDetail typeDescription
{ groupId: string; open: boolean }fires when a header group expands or collapses.
Methods1
Method / ArgumentsReturn typeDescription
groupId: string, open: boolean
Promise<void>expand/collapse a header group by id (`groupId` or its declaration path). No-ops when the state already matches.
ColumnDef1
ColumnDefType / RequiredDescription
'open' | 'closed'Optionalvisibility rule relative to the parent header group's open/closed state (AG `columnGroupShow`): `'open'` shows only while the group is expanded, `'closed'` only while collapsed, omitted always. Any child declaring this gives the group its expand/collapse toggle.