Treeview
This page describes how to set up and configure the Treeview component, an interactive tree used for navigation which is integrated with view state parameters.
Set up a Treeview
To set up a Treeview component, click-and-drag the component into the workspace and configure the Treeview properties described in the next section.
Treeview properties
The following sections provides details on how to configure the properties of the Treeview component.
Basics
Open the Basics properties on the right and configure the properties described in the following table.
Field |
Description |
---|---|
Name |
A name for the component provided by the user. |
Data Source |
The TreeView data source should include integer data columns for Node Id and Parent node, and a text label column. Refer to Data sources for further details. |
Node ID |
The data source column of unique integer values for each folder and item in the TreeView. Node IDs are used to define which items are checked, opened or selected. This is a required column |
Parent nodes |
A data source column which defines the TreeView layout. Start by defining which nodes are to be part of the top level directory; these are assigned a null value based on the kdb type used. Each node sharing a value is part of same level; for example, the top level of an integer based hierarchy treeview must have a
For example, Parent Nodes defined by q Copy
Generates this layout:
|
Text |
The data source column containing the label for each folder and item. This is a required column |
Icon |
If an icon marker is to be used in place of the standard folder icon, then define the data source column containing the list of 64-bit or image URL links. |
Opened nodes |
Define which set of Nodes will be open on load. |
Opened Nodes ID |
A view state parameter of Node IDs, type symbol, bound to expanded parent folders. Expanded nodes will display all child items. Warning Default values Default Opened Nodes ID values, if set, will be superseded by Opened Nodes ID values assigned by the data source. If Opened Nodes has no corresponding data source column, then default Open Nodes ID values will be used if assigned. |
Checked Nodes ID |
A view state parameter of Node IDs, type symbol, bound to all checked items in the tree - including parent folder node ID/s. Warning Default values Default Checked Nodes ID values, if set, will be superseded by Checked Nodes values assigned by the data source. |
Check Parent |
Parent node (box) is checked on load. |
Selected Node ID |
A view state parameter of a single Node ID, type symbol, bound to an individually selected item, either a parent folder or child item. Note Selected vs Checked The Selected Node ID is a single Node ID of the currently selected item in the tree view, which may or may not be checked - only one item can be selected at any one time (parent or child). Checked items are tracked by Checked Nodes ID. Warning Default values Default Selected Node ID value, if set, will be superseded by a value assigned by the data source. |
Check on Selected |
Check (box) when selecting nodes. |
Open on Selected |
Selecting the node name will expand child elements. |
Show Search |
Show/hide search input.
Entering a search string display the matched node and all ancestors and child nodes of the matched node.
|
Template Text |
Formats tree labels Text append example: Interactive tree nodes with a HTML Copy
|
Action
Refer to Actions for details.
Style, Margins and Format
Configure the Style properties defined in the following table.
Field |
Description |
---|---|
Hide Checkboxes |
This is disabled by default and hides checkboxes when enabled. |
Show Tooltip |
This is enabled by default and shows node |
Tooltip Text Template |
This allows you to define tooltip template text. If this is not defined it defaults to the node |
Advanced CSS |
The treenode Node Id must be referenced when applying CSS styles to icons in the treeview. For example, this is the CSS for the earlier Treeview using fontawesome icons: CSS Copy
where
|
CSS Classes |
Refer to Style for additional information on common settings.