Items Selection

Tree provides an ability to select leaves and branches within it.

Single-item selection

By default, selection is disabled in Tree. To activate it you should set the select parameter to true.

Enabling selection in Tree

tree = new webix.ui({
  view: "tree",
  ...
  select: true
})

Related sample:  Selection

Multiple selection

To enable multiple selection in Tree, you should set parameter select to multiselect.

Enabling multi-selection in Tree

tree = new webix.ui({
  view: "tree",
  ...
  select: "multiselect"
})

Related sample:  Multiline Selection

Related methods

getSelectedIdmethodreturns the selected cells
moveSelectionmethodmoves selection in the specified direction
selectmethodselects the specified item
selectAllmethodselects all items
isSelectedmethodchecks whether the specified item is selected or not
unselectmethodcancels selection of the specified item
unselectAllmethodremoves selection from all items

Related events

onAfterSelecteventfires after a cell is selected
onBeforeSelecteventfires before a cell is selected
onSelectChangeeventfires when selection is changed in DataTable
Back to top