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-tree

Events

hoops-view-tree-node-click

Emitted when a view node is clicked

Since

2025.8.0

Constructors

wvc.HoopsViewTreeElement.constructor()
HoopsViewTreeElement(): HoopsViewTreeElement

Returns: 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 undefined
set model(model: (undefined | IModel)): void

Sets the model instance for view data. Setting a new model will refresh the tree view.

Parameters

model: (undefined | IModel)

The model instance to set

Returns: 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 IDs
set selected(value: number[]): void

Sets the currently selected view nodes.

Parameters

value: number[]

Array of node IDs to select

Returns: 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 undefined
set viewAdapter(value: ViewAdapter): void

Sets 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 set

Returns: 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 from

Returns: T

The custom data stored for the node

Throws

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 deselect

selected: boolean

Whether to select (true) or deselect (false) the nodes

Returns: 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 for

data: unknown

The data to store with the node

Returns: 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 for

data: unknown

The data to merge with existing node data

Returns: void

Throws

When view adapter or tree element is not initialized