Create a new treeView inside the given element
The elements in which the tree will be rendered
The options for the tree, the data is passed here too
Optional themes to apply to the tree
{string}
Whether this treeview was already initialized
A flat list representation of all nodes (unsorted)
The options used to initialize this treeView
A flat list representation of all nodes, sorted by their nodeId, which gives you the render order
The hierarchically tree of nodes
Construct the tree style CSS based on user options
This function is called when a node is clicked. The respective action is triggered depending on the type of the event target
Destroy this instance
Looks up the DOM for the closest parent list item to retrieve the data attribute nodeid, which is used to look up the node in the flattened structure.
The element that should be searched for
Expands the given nodes by the given number of levels
Find nodes that match a given criteria
A given string to match against
Attribute to compare pattern against
Valid RegEx modifiers
nodes - Nodes that match your criteria
Recursive find for retrieving nested attributes values All values are return as strings, unless invalid
Typically a node, could be any object
Identifies an object property using dot notation
value - Matching attributes string representation
This function updates the list of checked nodes (see this._checkedNodes)
Initialize the treeView using the given options
Inject the inline style elements into the head
Asynchronously load the data for the tree, depending on the settings
Asynchronously load the data from the data property passed as options
Asynchronously load the data from a network source using fetch
Register the given node at this tree view. This is called in BSTreeViewNode::_updateChildHierarchy
Render the treeview and trigger EVENT_TRIGGERED at the end
Sort an unsorted flat representation of the tree by their nodeId. This gives a flat list in the order which can be rendered
Subscribe the events for this treeView. This includes the onEvent listeners passed by options and the click handler
Trigger the given event type on the global DOM element using the options
The event type to trigger
The data which is passed as detail.data
Unsubscribe the events for this treeView. This includes the onEvent listeners passed by options and the click handler
Call this function after changes to the tree have been made to regenerate the flat structures
Add nodes to the tree, at the specified position of parent
An array of nodes to add
The node to which nodes will be added as children. Set null if it should be added to the root.
Zero based insert index, where the node will be inserted. If not specified, the node will be added to the end of the list.
Add nodes to the tree after given node.
An array of nodes to add
The node to which nodes will be added after
Add nodes to the tree before given node.
An array of nodes to add
The node to which nodes will be added before
Check all tree nodes
Checks given tree nodes
An array of nodes
Clears previous search results
Collapse all tree nodes
Collapse a given tree node
An array of nodes
Disable all tree nodes
Disable given tree nodes
An array of nodes
Enable all tree nodes
Enable given tree nodes
An array of nodes
Expand all tree nodes
Expand given tree nodes
An array of nodes
Returns an array of matching node objects.
A pattern to match against a given field
field - Field to query pattern against
Returns an array of checked nodes.
nodes - Checked nodes
Returns an array of collapsed nodes.
nodes - Collapsed nodes
Returns the options used to initialize this treeView
Returns an array of disabled nodes.
nodes - Disabled nodes
Returns an array of enabled nodes.
nodes - Enabled nodes
Returns an array of expanded nodes.
nodes - Expanded nodes
Returns a flat array of node objects ordered by their path.
nodes - An array of all nodes
Returns the number of all nodes in the treeView (including all children)
Returns parent nodes for given nodes, if valid otherwise returns undefined.
An array of nodes
nodes - An array of parent nodes
Returns the root nodes in the treeView
Returns the number of root nodes in the treeView
Returns all nodes that were found by the last search
Returns an array of selected nodes.
nodes - Selected nodes
Returns an array of sibling nodes for given nodes, if valid otherwise returns undefined.
An array of nodes
nodes - An array of sibling nodes
Returns the dom element to which the treeview is attached to
Returns an array of unchecked nodes.
nodes - Unchecked nodes
Returns an array of unselected nodes.
nodes - Unselected nodes
Destroys and remove this treeView from the DOM
Removes given nodes from the tree.
An array of nodes to remove
Reveals given tree nodes, expanding the tree from node to root.
An array of nodes
Searches the tree for nodes (text) that match given criteria
A given string to match against
Search criteria options
nodes - Matching nodes
Selects all currently unselected nodes.
Selects given tree nodes
An array of nodes
Toggles a node's checked state; checking if unchecked, unchecking if checked.
An array of nodes
Toggles a node's disabled state; disabling is enabled, enabling if disabled.
An array of nodes
Toggles a node's expanded state; collapsing if expanded, expanding if collapsed.
An array of nodes
Toggles a node selected state; selecting if unselected, unselecting if selected.
An array of nodes
Uncheck all tree nodes
Uncheck given tree nodes
An array of nodes
Saves the current state of checkboxes as default, cleaning up any highlighted changes
Unselects all currently selected nodes.
Unselects given tree nodes
An array of nodes
Updates / replaces a given tree node
A single node to be replaced
THe replacement node
Generated using TypeDoc
This class allows to create and represent the TreeView element.