Skip to main content

Tree View

The TreeView widget is used to represent hierarchical data structures visually. It allows users to expand and collapse nodes, making it ideal for displaying nested relationships such as file directories, category structures, organizational hierarchies, and more.

Key Features​

  • Dynamically renders hierarchical data structures.
  • Supports single and multi-selection of tree nodes.
  • Allows custom icons and labels for each node.
  • Provides event bindings for node selection.

How to Use​

  • Drag Tree view widget from the widget explorer and drop it on the designer area.
  • Select the selection type (Multi / Single).
  • Provide the datasource.
  • On selection / deselection, listen to the change event emitter and perform the custom logic based on the selected/deselected node.

Sample Datasource — Displaying a Company Hierarchy:

[
{
"label": "Head Office",
"children": [
{
"label": "HR Department",
"children": [
{ "label": "Recruitment Team" },
{ "label": "Employee Relations" }
]
}
]
},
{
"label": "Engineering",
"children": [
{ "label": "Frontend Team" },
{ "label": "Backend Team" }
]
}
]

Following are the properties to be configured for this widget:

PropertyDescriptionComments
Basic Configuration
MultiSelectionSpecify whether multiple selections are allowed. Select either Yes or No.Single selection: only one node can be selected at a time. Multi-selection: multiple nodes can be selected at once, stored in selectedValue binding.
LabelProvide the label for the tree view.-
Label AlignmentSpecify the label alignment.Left, Right, Top.
Label Control RatioSelect the column ratio for the label.-
Basic Bindings
DatasourceSelect the data source from the dropdown.An array of objects where each object represents a node. Each node can have: label – text displayed, data – optional extra data, children – array of child nodes, expanded – boolean to expand initially (optional), icon – custom icons (optional).
Selected ValueSelect the value that needs to be selected by default from drop-down.Single Selection: the corresponding node object is stored as a single entity. Multi-Selection: an array of selected node objects is stored.
VisibilityProvide the expression using the expression builder. The control is visible only if the evaluated expression is true.-
CSS ClassSelect the CSS class.-
ChangeSelect the event that needs to happen when an item is selected from the tree view.The change event is triggered when a node is selected. It provides the selected node object as an event parameter.
Style & Layout
HeightProvide an integer value.-
WidthProvide an integer value.-
Unit TypeSelect the unit type: px, rem, %.Applicable for Height and Width.
CSS ClassProvide the CSS class binding using an expression builder.Applied at the tree root level.
StyleProvide the CSS rule sets for customizing the tree view.Applied at the tree root level.
Additional Configuration
TitleProvide the title.-
Id*Provide a unique identifier.An id is created by default. User can change the unique id as required.
CommentSelect from Yes or No options.Default is No. Select Yes to comment the Treeview.

Note: An asterisk (*) denotes that the property is mandatory for adding a Tree View.

Style and layout group, Style bindings, ARIA attributes bindings, and Attribute configuration need to be referred and added from the common configuration groups document.

The "Configuration saved successfully" message displays upon successfully adding the widget.

Tree View