Skip to main content

Tree API overview

Methods

NameDescription
checkItem()checks the checkbox of a tree item and all its sub-items
collapse()collapses a tree item by id
collapseAll()collapses all expanded Tree items
destructor()releases the occupied resources
editItem()edits a Tree item
expand()expands a tree item by id
expandAll()expands all collapsed tree items
focusItem()sets focus to an item by its id and moves the scroll to it
getChecked()gets all checked tree items
getState()gets the state of a tree
paint()repaints Tree on a page
setState()sets state for a tree
toggle()opens/closes a tree item by id
uncheckItem()unchecks the checkbox of a tree item and all its sub-items
important

Events

NameDescription
afterCheckfires after the state of an item is changed
afterCollapsefires after collapsing a tree item
afterDragfires after dragging of an item is finished
afterDropfires before the user has finished dragging an item but after the mouse button is released
afterEditEndfires after editing of a tree item is finished
afterEditStartfires after editing of a tree item has started
afterExpandfires after expanding a tree item
beforeCheckfires before the state of an item is changed
beforeCollapsefires before collapsing a tree item
beforeDragfires before dragging of an item has started
beforeDropfires before the user has finished dragging an item and released the mouse button
beforeEditEndfires before editing of a tree item is finished
beforeEditStartfires before editing of an item has started
beforeExpandfires before expanding a tree item
cancelDropfires on moving a mouse pointer out of item's borders while dragging the item
canDropfires when a dragged item is over a target item
dragInfires when an item is dragged to another potential target
dragOutfires when an item is dragged out of a potential target
dragStartfires when dragging of an item has started
focusChangefires on moving focus to a new item
itemClickfires on clicking a tree item
itemDblClickfires on double-clicking a tree item
itemRightClickfires on right-clicking a tree item
important

Properties

NameDescription
autoloadOptional. Defines that the structure of a tree is being built while opening items
checkboxOptional. Adds checkboxes to tree items
collapsedOptional. Defines that a tree is initialized in the collapsed state
cssOptional. Adds a CSS class(es) to the component
dataOptional. Sets a dataset for a tree
dragCopyOptional. Defines that an item is copied to a target during drag-n-drop
dragModeOptional. Enables drag-n-drop in Tree
dropBehaviourOptional. Defines the behaviour of a dragged item
editableOptional. Enables editing of Tree items on a double-click
eventHandlersOptional. Adds event handlers to the HTML elements of a custom template
iconOptional. Allows adding custom icons for tree items
isFolderOptional. Defines whether an item should be rendered as a folder
itemHeight Optional. Sets the height of an item
keyNavigationOptional. Enables key navigation in a tree
rootIdOptional. Sets the id for the root element
selectionOptional. Enables selection of Tree items
templateOptional. Specifies a template for Tree items