HoopsViewTreeElement
-
class
wvc.HoopsViewTreeElement() Provides a tree view for displaying and managing saved views and view configurations.
This component displays a hierarchical tree of saved views including standard views, annotation views, and combined state views. It supports lazy loading for better performance with large view sets and provides selection and navigation capabilities.
Examples
<hoops-view-tree></hoops-view-tree> <script> document.getElementsByTagName('hoops-view-tree')[0].model = modelInstance; document.getElementsByTagName('hoops-view-tree')[0].addEventListener('hoops-view-tree-node-click', (event) => { console.log('View clicked:', event.detail); }); </script>
Custom Element
hoops-view-treeEvents
hoops-view-tree-node-click
Emitted when a view node is clickedSince
2025.8.0
Constructors
-
wvc.HoopsViewTreeElement.constructor() - HoopsViewTreeElement():
HoopsViewTreeElementReturns:
HoopsViewTreeElement
Accessors
-
wvc.HoopsViewTreeElement.model() - get model(): (undefined | IModel)
The IModel interface that represents the Model.
This is a syntactic sugar to access HoopsViewTree.viewAdapter.model. If the ViewAdapter is not set it returns an undefined.
Reassigning the model will trigger an update.
Trying to set the model while the viewAdapter is not set would result in an error being thrown.
This should not happen in a normal use case since the viewAdapter is added to the view tree at initialization.
Returns: (undefined | IModel)
The current model instance or undefinedset model(model: (undefined | IModel)): voidSets the model instance for view data. Setting a new model will refresh the tree view.
Parameters
model: (undefined | IModel)
The model instance to setReturns: void
Throws
When setting model before view adapter initialization
-
wvc.HoopsViewTreeElement.selected() - get selected(): number[]
Gets the currently selected view nodes.
Returns: number[]
Array of selected node IDsset selected(value: number[]): voidSets the currently selected view nodes.
Parameters
value: number[]
Array of node IDs to selectReturns: void
Throws
When setting selected nodes before tree initialization
-
wvc.HoopsViewTreeElement.treeElement() - get treeElement(): (undefined | Tree)
Gets the internal tree component element. Provides access to the underlying tree functionality.
Returns: (undefined | Tree)
The tree element instance or undefined if not initialized
-
wvc.HoopsViewTreeElement.viewAdapter() - get viewAdapter(): (undefined | ViewAdapter)
Gets the view adapter that manages tree data and operations.
Returns: (undefined | ViewAdapter)
The current view adapter or undefinedset viewAdapter(value: ViewAdapter): voidSets the view adapter that manages tree data and operations. The adapter handles communication between the tree component and the model.
Parameters
value: ViewAdapter
The view adapter to setReturns: void
Throws
When setting adapter before tree initialization
Methods
-
wvc.HoopsViewTreeElement.getNodeData() - getNodeData(nodeId: number): T
Retrieves custom data associated with a view node.
Parameters
nodeId: number
The ID of the node to get data fromReturns: T
The custom data stored for the nodeThrows
When view adapter is not initialized
-
wvc.HoopsViewTreeElement.selectNodes() - selectNodes(nodeIds: number[], selected: boolean): void
Selects or deselects view nodes in the tree.
Parameters
nodeIds: number[]
Array of node IDs to select or deselectselected: boolean
Whether to select (true) or deselect (false) the nodesReturns: void
Throws
When tree element is not initialized
-
wvc.HoopsViewTreeElement.setNodeData() - setNodeData(nodeId: number, data: unknown): void
Sets custom data for a view node, replacing any existing data.
Parameters
nodeId: number
The ID of the node to store data fordata: unknown
The data to store with the nodeReturns: void
Throws
When view adapter or tree element is not initialized
-
wvc.HoopsViewTreeElement.updateNodeData() - updateNodeData(nodeId: number, data: unknown): void
Merges custom data into a view node’s existing data. Arrays are concatenated, objects are merged, other types replace existing data.
Parameters
nodeId: number
The ID of the node to update data fordata: unknown
The data to merge with existing node dataReturns: void
Throws
When view adapter or tree element is not initialized