extractLeaves

DataTable
stable

Recursively collects all leaf (childless) headers from a nested DataTable header tree into a flat array. Used to derive the rendered column list from a grouped header definition.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

item
required
IInternalDataTableHeader
The root header node to traverse. If it has no children it is collected as a leaf; otherwise its children are recursed.
columns
Array<IInternalDataTableHeader>
[]
Accumulator array. A new empty array is created when omitted.

API

Return value

The value returned by this util.

A flat array of all leaf headers (those without children) in depth-first order.

Usage

Examples

Ready-to-paste usage snippets.

Flatten grouped headers to leaf columns

typescript