Tree API
When rendering the
TreeDataSource
component, you can get access to the Tree API by reading it from the DataSource API treeApi
property.<DataSource<DATA_TYPE> onReady={(api: DataSourceApi<DATA_TYPE>) => { api.treeApi // <---- // treeApi is accessible here // you may want to store a reference to it in a ref or somewhere in your app state }}
COPY
For updating tree nodes, see the following methods:
collapseAll
() => void
collapseNode
(nodePath: NodePath, options?: {force?: boolean}) => void
deselectAll
() => void
deselectNode
(nodePath: NodePath) => void
expandAll
() => void
expandNode
(nodePath: NodePath, options?: {force?: boolean}) => void
isNodeExpanded
(nodePath: NodePath) => boolean
selectAll
() => void
selectNode
(nodePath: NodePath) => void
toggleNode
(nodePath: NodePath, options?: {force?: boolean}) => void
toggleNodeSelection
(nodePath: NodePath) => void