API REFERENCE

treeNodeToggled

Emitted when tree expansion changes. Inspect the path and expanded state.

What does this API do?

Emitted when tree expansion changes. Inspect the path and expanded state.

API for Pro features: Tree data

Exact input and result types

typescript
treeNodeToggled: { path: readonly string[]; expanded: boolean }

Usage flow

Subscribe with grid.addEventListener('treeNodeToggled', handler). The result is in event.detail, and event names are case-sensitive. Remove subscriptions when disposing of the view.

javascript
const controller = new AbortController();
grid.addEventListener('treeNodeToggled', event => {
  console.log(event.detail);
}, { signal: controller.signal });
// On view disposal: controller.abort();

Feature explanations and examples