Tree control
Introduction
The tree control component displays hierarchical relational data in a tree structure, allowing users to browse and manage data by expanding, collapsing, and selecting each node.
Configuration items
Category |
Configuration |
Example |
Description |
Content |
Option list |
Data source for the tree control component. Manual configuration and mapping patterns are supported. |
|
Expanded items |
|
The value of the currently expanded tree node. |
|
Interaction |
Hide |
Controls the default display state of the tree control component. When set to |
|
Disable |
Specifies whether to disable the tree control component. |
||
Checkbox |
Specifies whether to display checkboxes. |
||
Drag and Drop |
Specifies whether tree nodes are draggable. |
||
Search |
Specifies whether to display the search box. |
||
Style |
Height |
Component height. For more information, see General properties. |
|
Margin |
For more information, see General properties. |
||
Show icon |
Specifies whether to use custom expand/collapse icons. If this is not enabled, default icons are used. |
||
Icon mode |
When "Show icon" is enabled, you can select an icon mode. |
||
Fixed icon |
Three fixed sets of icons are provided. |
||
Custom icon |
Customize the expand/collapse icons for tree nodes. If you only set the expand icon, the collapse icon is the expand icon rotated 90 degrees counter-clockwise. If you only set the collapse icon, the expand icon is the collapse icon rotated 90 degrees clockwise. |
||
Node occupies full row |
Specifies whether a node occupies the entire row. |
||
Show connecting lines |
Specifies whether to show connecting lines between tree nodes. |
||
CSS style |
Node hover background color |
The background color when the mouse hovers over a tree node. |
|
Node selected background color |
The background color when a tree node is selected. |
||
Text color |
The text color of tree nodes. |
||
Search match text color |
The color of the text that matches the search query in a tree node. For each node, this applies only to the first matched text. |
Properties and methods
Name |
Type |
Example |
Description |
treeData |
array |
|
Read-only. The data source of the current tree control component. |
expandedKeys |
array |
|
The expanded items of the current tree control component. |
checkedKeys |
array |
|
The selected items of the current tree control component. |
disabled |
boolean |
|
Specifies whether the current tree control component is disabled. |
showSearch |
boolean |
|
Specifies whether the data source of the tree control component can be searched. |
checkable |
boolean |
|
Specifies whether to display checkboxes for tree nodes. |
draggable |
boolean |
|
Specifies whether tree nodes are draggable. |
hidden |
boolean |
|
Specifies whether the current component is hidden. For more information, see General properties. |
setExpandedKeys |
func |
|
Sets the value of the expanded node in the tree control to |
clearExpandedKeys |
func |
|
Clears the value of the expanded node in the tree control. |
setCheckable |
func |
|
Enables or disables checkboxes for the tree control. The parameter can be |
clearCheckable |
func |
|
Clears the checkbox state of the tree control. |
setCheckedKeys |
func |
|
When checkboxes are enabled, sets the value of the selected checkbox node in the tree control to |
clearCheckedKeys |
func |
|
Clears the value of the selected checkbox node in the tree control. |
setDraggable |
func |
|
Enables or disables dragging for the tree control. The parameter can be |
clearDraggable |
func |
|
Clears the draggable state of the tree control. |
setDisabled |
func |
|
Enables or disables the tree control. The parameter can be |
clearDisabled |
func |
|
Clears the disabled state of the tree control. |
setShowSearch |
func |
|
Specifies whether to allow filtering the data source of the tree control. The parameter can be |
clearShowSearch |
func |
|
Clears the filtering state of the tree control. |
setHidden |
func |
|
Hides or shows the tree control. The parameter can be |
clearHidden |
func |
|
Clears the hidden state of the tree control. For more information, see General properties. |
Event callbacks
Configuration |
Description |
The event that is triggered when a node in the tree control is selected. |
|
The event that is triggered when a tree node is expanded. |
|
The event that is triggered when a tree node checkbox is selected. |
|
The event that is triggered when a search is performed on the tree nodes. |
