CngxTreeControllerOptions
projects/common/interactive/tree-controller/tree-controller.ts
Import#
import { CngxTreeControllerOptions } from '@cngx/common/interactive'
Description#
Configuration for createTreeController.
nodeIdFn is required on purpose: the controller hands its ids out to
expandedIds, to selection memoization (keyFn consumers), and to the
stable-identity isExpanded(id) signal cache. A non-stable id (e.g. the
path-based fallback from flattenTree) silently breaks all three the
moment the tree is sorted or filtered - exactly the Sort/Filter
integration pattern this stack is designed to support. Forcing the
caller to think about identity at construction eliminates that whole
class of heisenbugs.
Index#
Instance Properties#
Bound the isExpanded(id) signal cache. Default: unlimited.
Resolution: per-options > provideTreeConfig.cacheLimit >
unlimited. See CngxTreeConfig.cacheLimit for trade-offs.
"all" | "none" | unknownInitial expansion. Resolution: per-options >
provideTreeConfig.defaultInitiallyExpanded > 'none'.
Evaluated once at construction; later tree changes do not re-apply.
Re-trigger via expandAll() if needed.
Membership key. Defaults (in resolution order): per-options >
provideTreeConfig default > identity.
Visible label. Defaults (in resolution order): per-options >
provideTreeConfig default > String(value).
Derives a stable id per flat node - must survive re-ordering and
filtering of the source tree. Use a domain id ((v) => v.id)
rather than a positional fallback.
Resolution: per-options > app-wide provideTreeConfig default >
dev-mode error. At least one source must provide the function.