Component Palette Icon:
The Tree View component can display any tree hierarchy. It is configured by filling in a dataset. Each column title in the dataset is a property of the Tree View Customizer.
Each row in the dataset will become a node in the tree. Each node has a path that determines its location in the tree, for example, "West Area/Process/Valve1". The Separation Character property dictates how the paths are broken up. Any missing folder nodes needed by a leaf node are created implicitly. The other columns in the dataset besides "Path" are used to configure the look for the node, both when it is selected and when it is not. All column properties in the dataset are described in the Tree View Customizer.
Name | Description | Property Type | Scripting | Category | |
---|---|---|---|---|---|
Auto Expand | If true, the tree will automatically expand the tree structure up to the level specified by Auto Expansion Level. | boolean | .autoExpand | Behavior | |
Auto Expansion Level | If Auto Expand is true, this is the depth level that will be expanded. Zero means expand-all. | int | .autoExpansionLevel | Behavior | |
Auto Sort | Whether or not to automatically sort the tree. | boolean | .autoSort | Behavior | |
Background Color | The background color of the component. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector. | Color | .background | Appearance | |
Border | The border surrounding this component. Options are: No border, Etched (Lowered), Etched (Raised), Bevel (Lowered), Bevel (Raised), Bevel (Double), Button Border, Field Border, Line Border, and Other Border.
| Border | .border | Common | |
Default Closed Icon | The default closed icon if no icon is set. | String | .defaultClosedIconPath | Appearance | |
Default Leaf Icon | The default leaf icon if no icon is set. | String | .defaultLeafIconPath | Appearance | |
Default Node Background | The default background of a node if no background is set. See Color Selector. | Color | .defaultBackground | Appearance | |
Default Node Border | The default border of a node if no border is set. | Border | .defaultBorder | Appearance | |
Default Node Foreground | The default foreground of a node if no foreground is set. See Color Selector. | Color | .defaultForeground | Appearance | |
Default Node Selected Background | The default selected background of a node if no background is set. See Color Selector. | Color | .defaultSelectedBackground | Appearance | |
Default Node Selected Border | The default selected border of a node if no border is set. | Border | .defaultSelectedBorder | Appearance | |
Default Node Selected Foreground | The default selected foreground of a node if no foreground is set. See Color Selector. | Color | .defaultSelectedForeground | Appearance | |
Default Open Icon | The default open icon if no icon is set. | String | .defaultOpenIconPath | Appearance | |
Enabled | If disabled, a component cannot be used. | boolean | .componentEnabled | Common | |
Font | Font of text on this component. | Font | .font | Appearance | |
Full Width Selection | Whether to paint the selection across the width of the tree. Default is true. | boolean | .fullWidthSelection | Appearance | |
Items | Contains the items of the tree view. | Dataset | .data | Data | |
Line Style | The tree's line style. | int | .lineStyle | Appearance | |
Mouseover Text | The text that is displayed in the tooltip which pops up on mouseover of this component. | String | .toolTipText | Common | |
Name | The name of this component. | String | .name | Common | |
Quality | The data quality code for any Tag bindings on this component. | QualityCode | .quality | Data | |
Row Height | The height of each row in the tree. | int | .rowHeight | Appearance | |
Selected Item | The index of the currently selected item, or -1 if no selection. | int | .selectedItem | Data | |
Selected Path | The path of the currently selected item, or "" if no selection. | String | .selectedPath | Data | |
Selection Fill Color | The background color to fill the selection width with. See Color Selector. | Color | .selectionFillColor | Appearance | |
Selection Mode | What kind of selection regions does the tree allow. Options are Single, Multiple - Contiguous, and Multiple - Discontiguous. | int | .selectionMode | Behavior | |
Separation Character | The separation character for the path. | String | .separationCharacter | Behavior | |
Show Root Handles | Whether or not to show handles next to parent nodes. | boolean | .showRootHandles | Appearance | |
Visible | If disabled, the component will be hidden. | boolean | .visible | Common | |
Deprecated Properties | |||||
Data Quality | The data quality code for any Tag bindings on this component. | int | .dataQuality | Deprecated |
Clears the current selection.
Nothing
Nothing |
Collapses all nodes in the tree.
Nothing
Nothing |
Expands all nodes in the tree.
Nothing
Nothing |
Returns a list of the selected item's indexes. These are the row indexes that the selected tree nodes were found in the underlying dataset. Implicitly created folder nodes that have no index will not be included.
Nothing
List of Integers |
Returns a list of the selected item's paths. A path to an item is the path to its parent plus its normal (non-selected) text.
Nothing
List of Strings |
This component does not have extension functions associated with it.
//The Selected Item property will be updated as the user selects different nodes in the tree. //It represents the index in the Items dataset at which the node is defined. If the selected //node was implicitly created, the Selected Item will be -1. //You can use this index to get the path and name of the selected node with an expression binding like this: if ({Root Container.Tree View.selectedItem}<0,"n/a",{Root Container.Tree View.data}[{Root Container.Tree View.selectedItem},"text"]) |
#This script will swap to the script that was double clicked on, if this code is placed in the mouseClicked event handler for the treeview #This script utilizes an extra column called windowPath that contains the full path to the window. You can add an extra column to the Items dataset property #as long as the column name doesn't match one of the reserved column titles listed above. if event.clickCount == 2: row = event.source.selectedItem data = event.source.data if row != -1: # Grab the window path value out of the tree view's items dataset windowPath = data.getValueAt(row, "windowPath") system.nav.swapTo(windowPath) |