API REFERENCE

setTreeNodeExpanded

Expands or collapses a tree node by path. Leaf nodes and missing paths cannot be expanded.

What does this API do?

Expands or collapses a tree node by path. Leaf nodes and missing paths cannot be expanded.

API for Pro features: Tree data

Exact input and result types

typescript
setTreeNodeExpanded(path: readonly string[], expanded: boolean): Promise<void>
ArgumentsRequiredType
pathRequiredreadonly string[]
expandedRequiredboolean

The return type is Promise<void>.

Usage flow

After registering and initializing the Grid element, call grid.setTreeNodeExpanded(…). Read the return value with await. For methods returning a boolean or report, inspect the result before continuing.

Feature explanations and examples