TreeViewModel
此内容尚不支持你的语言。
Defined in: ui/collection/tree-data-source.ts:38
Iterative traversal handles deep trees; stable IDs retain state through reorder.
Type Parameters
Section titled “Type Parameters”T
Implements
Section titled “Implements”DataSource<TreeRow<T>>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TreeViewModel<
T>(source,expanded?):TreeViewModel<T>
Defined in: ui/collection/tree-data-source.ts:48
Parameters
Section titled “Parameters”source
Section titled “source”expanded?
Section titled “expanded?”readonly TreeItemId[] = []
Returns
Section titled “Returns”TreeViewModel<T>
Properties
Section titled “Properties”source
Section titled “source”
readonlysource:TreeDataSource<T>
Defined in: ui/collection/tree-data-source.ts:48
Accessors
Section titled “Accessors”expandedIds
Section titled “expandedIds”Get Signature
Section titled “Get Signature”get expandedIds(): readonly
TreeItemId[]
Defined in: ui/collection/tree-data-source.ts:65
Returns
Section titled “Returns”readonly TreeItemId[]
selectedIds
Section titled “selectedIds”Get Signature
Section titled “Get Signature”get selectedIds(): readonly
TreeItemId[]
Defined in: ui/collection/tree-data-source.ts:66
Returns
Section titled “Returns”readonly TreeItemId[]
Methods
Section titled “Methods”canDrop()
Section titled “canDrop()”canDrop(
request):boolean
Defined in: ui/collection/tree-data-source.ts:123
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”boolean
dispose()
Section titled “dispose()”dispose():
void
Defined in: ui/collection/tree-data-source.ts:131
Returns
Section titled “Returns”void
getCount()
Section titled “getCount()”getCount():
number
Defined in: ui/collection/tree-data-source.ts:54
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”getItem()
Section titled “getItem()”getItem(
index):TreeRow<T>
Defined in: ui/collection/tree-data-source.ts:55
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”TreeRow<T>
Implementation of
Section titled “Implementation of”getItemId()
Section titled “getItemId()”getItemId(
_index,row):TreeItemId
Defined in: ui/collection/tree-data-source.ts:59
Stable identity to support future reorder-aware diffing.
Parameters
Section titled “Parameters”_index
Section titled “_index”number
TreeRow<T>
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getNode()
Section titled “getNode()”getNode(
id):TreeRow<T> |undefined
Defined in: ui/collection/tree-data-source.ts:60
Parameters
Section titled “Parameters”Returns
Section titled “Returns”TreeRow<T> | undefined
indexOf()
Section titled “indexOf()”indexOf(
id):number
Defined in: ui/collection/tree-data-source.ts:64
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
isSelected()
Section titled “isSelected()”isSelected(
id):boolean
Defined in: ui/collection/tree-data-source.ts:116
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
refresh()
Section titled “refresh()”refresh():
void
Defined in: ui/collection/tree-data-source.ts:72
Build transactionally: invalid IDs/cycles leave the previous projection intact.
Returns
Section titled “Returns”void
reveal()
Section titled “reveal()”reveal(
id):void
Defined in: ui/collection/tree-data-source.ts:118
Reveal ancestors without forcing any project-specific selection policy.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
select()
Section titled “select()”select(
ids,mode?):void
Defined in: ui/collection/tree-data-source.ts:109
Parameters
Section titled “Parameters”readonly TreeItemId[]
number = 1
Returns
Section titled “Returns”void
setExpanded()
Section titled “setExpanded()”setExpanded(
ids):void
Defined in: ui/collection/tree-data-source.ts:99
Parameters
Section titled “Parameters”readonly TreeItemId[]
Returns
Section titled “Returns”void
subscribe()
Section titled “subscribe()”subscribe(
listener):Unsubscribe
Defined in: ui/collection/tree-data-source.ts:67
Subscribe to change notifications; returns an unsubscribe fn.
Parameters
Section titled “Parameters”listener
Section titled “listener”(change) => void
Returns
Section titled “Returns”Unsubscribe
Implementation of
Section titled “Implementation of”toggle()
Section titled “toggle()”toggle(
id):void
Defined in: ui/collection/tree-data-source.ts:104
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void