getHeaderDepth

Commons
stable

Recursively computes the maximum nesting depth of a DataTable header column tree. Used to calculate the rowspan for parent columns in multi-level header rows.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

item
required
IInternalDataTableHeader
The header item to measure. Recursively traverses its children array.
depth
number
0
The current recursion depth. Defaults to 0; increases by 1 at each level.

API

Return value

The value returned by this util.

The maximum depth of the subtree rooted at item (0 = leaf, 1 = one level of children, etc.).

Usage

Examples

Ready-to-paste usage snippets.

Measure a two-level header tree

typescript