Column Groups
Use columnGroups to display nested header bands above leaf columns.
Defining Nested Groups
Section titled “Defining Nested Groups”const grid = new Grid<Product>({ container, columnDefs: [ { key: 'id', name: 'ID', width: 64, pinned: 'start' }, { key: 'name', name: 'Product', width: 200 }, { key: 'category', name: 'Category', width: 130 }, { key: 'quantity', name: 'Qty', width: 90 }, { key: 'price', name: 'Price', width: 110 }, ], columnGroups: [ { groupId: 'catalog', name: 'Catalog', children: ['name', 'category'] }, { groupId: 'inventory', name: 'Inventory', children: [ 'quantity', { groupId: 'valuation', name: 'Valuation', children: ['price'] }, ], }, ], rowData,});Behavior & Constraints
Section titled “Behavior & Constraints”- Header Height Stacking: Each group nesting level adds one header row (
headerRowHeightor--next-grid-header-row-height, default30 px). - Static Group Topology:
columnGroupsare static declarations; column state (getColumnState/applyColumnState) persists leaf columns only. - Pinning & Visibility: Hidden leaf columns omit their cells from group spans; if all leaves in a group are hidden, the group header hides automatically. Groups span contiguous leaves within the same pin zone.
- Replacing Definitions: When calling
setColumnDefs, pass{ columnGroups }if you remove a column referenced by an existing group.