Backend\VueComponents\TreeView\NodeDefinition
Overview
NodeDefinition encapsulates Treeview node information.
Protected Properties
protected mixed $label
protected mixed $key
protected mixed $childKeyPrefix
protected mixed $displayMode
protected bool $draggable
protected bool $selectable
protected mixed $icon
protected array $nodes
protected mixed $userData
protected mixed $sortBy
protected mixed $groupBy
protected mixed $groupByMode
protected mixed $dragAndDropMode
protected mixed $rootMenuItems
protected mixed $description
protected mixed $hasApiMenuItems
protected mixed $displayProperty
protected mixed $noMoveDrop
protected mixed $multiSelect
protected mixed $hideInQuickAccess
Public Methods
public __construct()
public __construct($label, $key): void
public addNode()
public addNode($label, $key): void
public addRootMenuItem()
public addRootMenuItem($type, $label = null, $command = null): void
public getNodes()
public getNodes(): void
public setChildKeyPrefix()
public setChildKeyPrefix($prefix): void
public setDescription()
public setDescription($value): void
Sets node description. Node descriptions are rendered by the treeview component but their styling must be done by a parent component.
public setDisplayMode()
public setDisplayMode($value): void
Sets tree branch display mode - tree or list. Only the root node display mode is considered.
public setDisplayProperty()
public setDisplayProperty($displayProperty): void
Allows to set userData property name to use as the node label. Applies to root nodes only.
public setDragAndDropMode()
public setDragAndDropMode($mode): void
Sets tree branch drag and drop mode - sort, move (or both), or custom. Only the root node drag and drop mode is considered.
public setDraggable()
public setDraggable($value): void
Determines whether the node is draggable. Only the root node draggable value is considered.
public setFolderIcon()
public setFolderIcon(): void
public setGroupBy()
public setGroupBy($property): void
Sets optional grouping for a tree branch. Applies to root nodes only. Allows to group child nodes using a userData object property. Supported for the list display mode only.
public setGroupByMode()
public setGroupByMode($mode): void
public setHasApiMenuItems()
public setHasApiMenuItems($hasApiMenuItems): void
Indicates that the menu item supports API-generated menu items.
public setHideInQuickAccess()
public setHideInQuickAccess($value): void
Determines whether the node must be hidden in the Treeview Quick Access user interface. This affects only leaf nodes.
public setIcon()
public setIcon($backgroundColor, $iconClassName): void
public setMultiSelect()
public setMultiSelect($value): void
Determines whether multiple nodes can be selected. Only the root node property value is considered.
public setNoMoveDrop()
public setNoMoveDrop($value): void
Determines whether other nodes can be dropped to the node.
public setSelectable()
public setSelectable($value): void
Determines if the node is selectable. The value is ignored for root nodes - they cannot be selected.
public setSortBy()
public setSortBy($sortBy): void
Sets optional sorting for a tree branch. Applies to root nodes only. Allows to sort child nodes using userData object properties. Syntax: propertyName1,propertyName2:desc.
public setUserData()
public setUserData($userData): void
Sets optional user data object.
public setUserDataElement()
public setUserDataElement($key, $value): void
public toArray()
public toArray(): void