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.
Constructors
-
wvc.HoopsViewTreeElement.constructor() - HoopsViewTreeElement():
HoopsViewTreeElementReturns:
HoopsViewTreeElement
Properties
-
wvc.HoopsViewTreeElement.styles static
styles: CSSResult[]Array of styles to apply to the element. The styles should be defined using the ? tag function, via constructible stylesheets, or imported from native CSS module scripts.
Note on Content Security Policy:
Element styles are implemented with
<style>tags when the browser doesn’t support adopted StyleSheets. To use such<style>tags with the style-src CSP directive, the style-src value must either include ‘unsafe-inline’ ornonce-<base64-value>with<base64-value>replaced be a server-generated nonce.To provide a nonce to use on generated
<style>elements, setwindow.litNonceto a server-generated nonce in your page’s HTML, before loading application code:<script> // Generated and unique per request: window.litNonce = 'a1b2c3d4'; </script>
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
-
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
-
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
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 node
-
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
-
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
-
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