Backend\VueComponents\TreeView\NodeDefinition

Treeview node definition. Encapsulates Treeview node information.

Public methods

public void __construct($label, $key)
Parameters
  • $label
  • $key

public void addNode($label, $key)
Parameters
  • $label
  • $key

public void addRootMenuItem($type, $label=NULL, $command=NULL)
Parameters
  • $type
  • $label
  • $command

public void getNodes()

public void setChildKeyPrefix($prefix)
Parameters
  • $prefix

public void setDescription($value)

Sets node description. Node descriptions are rendered by the treeview component but their styling must be done by a parent component.

Parameters
  • $value

public void setDisplayMode($value)

Sets tree branch display mode - tree or list. Only the root node display mode is considered.

Parameters
  • $value

public void setDisplayProperty($displayProperty)

Allows to set userData property name to use as the node label. Applies to root nodes only.

Parameters
  • $displayProperty

public void setDragAndDropMode($mode)

Sets tree branch drag and drop mode - sort, move (or both), or custom. Only the root node drag and drop mode is considered.

Parameters
  • $mode

public void setDraggable($value)

Determines whether the node is draggable. Only the root node draggable value is considered.

Parameters
  • $value

public void setFolderIcon()

public void setGroupBy($property)

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.

Parameters
  • $property

public void setGroupByMode($mode)
Parameters
  • $mode

public void setHasApiMenuItems($hasApiMenuItems)

Indicates that the menu item supports API-generated menu items.

Parameters
  • $hasApiMenuItems

public void setHideInQuickAccess($value)

Determines whether the node must be hidden in the Treeview Quick Access user interface. This affects only leaf nodes.

Parameters
  • $value

public void setIcon($backgroundColor, $iconClassName)
Parameters
  • $backgroundColor
  • $iconClassName

public void setMultiSelect($value)

Determines whether multiple nodes can be selected. Only the root node property value is considered.

Parameters
  • $value

public void setNoMoveDrop($value)

Determines whether other nodes can be dropped to the node.

Parameters
  • $value

public void setSelectable($value)

Determines if the node is selectable. The value is ignored for root nodes - they cannot be selected.

Parameters
  • $value

public void setSortBy($sortBy)

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.

Parameters
  • $sortBy

public void setUserData($userData)

Sets optional user data object.

Parameters
  • $userData

public void setUserDataElement($key, $value)
Parameters
  • $key
  • $value

public void toArray()