The tree component loads source tables and uses these tables to render a visual tree. Each source table describes the children of some tree node.
The tree uses "lazy loading," which means that a child table is loaded only when the relevant tree node is expanded. In order to enable this lazy loading, you must build a special dataflow symbol. See About the Dataflow Symbol.
Note
The terms tree node and tree item are closely related. A node is a tree data unit. An item is the rendered visual entity for a node.
The top-level source table is loaded in dataflow and can describe the top-level tree nodes. For example, to create the tree in the image above, the top-level source table could contain one row each for floorplans, reports, and devices.
Note
Alternatively, the top-level source table can describe a root node that you do not want to appear in your tree. In such a case, set the Show Rootproperty to FALSE.
You bind the top-level source table to the Table property of the tree. All other source tables are loaded lazily.
All source tables must use the same column names for columns that are used to load tables, to identify tree items for selection, or to render tree items. These columns can include:
Name—By default, this name becomes the string displayed in the node. This behavior can be overridden by a visual symbol.
ID—This value is required and must be unique within a table. If a tree uses a property that requires unique IDs across tables, such as the Select Nodeproperty, this value must be unique across all source tables.
Whether the item has children—This boolean value is optional. If it is not defined, the user can attempt to expand any node, even if no children exist.
Dataflow symbol properties—This can be any column that is used to define lazy loading behavior, such as a path. See About the Dataflow Symbol.
Visual symbol properties—This can be any column that is passed to the items renderer for the visual symbol. See About the Visual Symbol.
About the Dataflow Symbol
The tree requires a special dataflow symbol for lazy loading. You must create this dataflow symbol and use the symbol name as the Data Symbol property of the tree.
The dataflow symbol must have two tabledata parameters. These parameters must be named input and output. If any other names are used, the tree might not work at all. These names are case sensitive. The input and output parameters represent any particular tree node and the children of that node, respectively. You must define the relationship between input and output within the symbol.
The following are some example methods for creating the dataflow symbol. For more examples, see the tree tutorials.
Example 1: Tables are parsed from CSV files on the server.
Any table that has children must include a column that contains the paths to the child CSV files.
Inside the dataflow symbol, add a String Loader block.
Hover over the String Loader's path property, click the blue dot, and choose Binding Path.
Set the binding path as @parent.@params.input.0_child, where child is the name of the table column that contains CSV file paths.
Whenever the column names change, for example if your query changes, you must re-bind the changed table columns to the renderer.
Tip
If the visual symbol has a default parameter, this parameter is automatically used as the name property of the tree. This shortcut works only if the dataflow symbol has been defined. To set a default symbol parameter, right-click the parameter in the parameters list in symbol editing mode and choose Make Default. See Symbol.
About Selection
This section configures how to configure tree selection, and it describes the Selected Items string and the Selected Items Data table.
How to Configure Selection
You can configure the selection behavior allowed by the tree. For example, the tree can allow one item to be selected, or it can allow multiple items to be selected. Selection behaviors are described here.
The following image shows the selection behaviors. See also: Selection Properties.
Selected Items and Selected Items Data
The Selected Items property is a comma-separated list of IDs of the selected items in the tree.
The Selected Items Data property is a table containing the source table rows for all currently selected tree items. This property allows you to pass data for selected items through the tree component to other parts of the project. For example, the tree tutorials include an example of using the selected items to drive a repeater. You can also perform operations on this table in the dataflow, using Table Operations dataflow blocks or the Script dataflow block. See also: Scripting and Syntax.
Table (Required)
Defines the table that the tree uses as a data source. This table contains the top level of nodes and references to the next level of nodes, if they exist. This table must include a column that contains item IDs.
The Table property
Item ID Column (Required)
Item ID Column (Required)
Item ID Column (Required)
Contains the name of a column in this tree's source table. This column contains IDs for tree nodes. IDs must be unique within a given table.
The Item ID Column property
Name Column (Recommended)
Name Column (Recommended)
Name Column (Recommended)
Contains the name of a column in this tree's source table. This column contains names for tree nodes. If default tree styling is used, the items in this column are used as display text. If a symbol is used for the tree, and the symbol has a default property defined, the items in this column are used for that default property.
The Name Column property
Has Children Column (Recommended)
Has Children Column (Recommended)
Has Children Column (Recommended)
Contains the name of a column in this tree's source table. This column indicates whether items in the tree have children and whether the disclosure icon is displayed. All values are considered TRUE except:
false
False
a null value
any string that is parsed as 0
If no column is set, the disclosure icon is always displayed, and an attempt can always be made to load children.
The Has Children Column property
Symbol
Symbol
Symbol
Optionally, this property can be used to specify a symbol to represent the tree nodes, instead of the default tree styling.
The Symbol property
Data Symbol (Required)
Data Symbol (Required)
Data Symbol (Required)
Specifies the name of the dataflow symbol to be used by this tree. As described here, the dataflow symbol must include input and outputtabledata parameters. This symbol takes a one-row table and returns the child table that it refers to, if any.
The Data Symbol property
Data Loading Timeout
Data Loading Timeout
Data Loading Timeout
Specifies how long, in seconds, DGLux5 will attempt to load a child table before stopping the attempt.
The Data Loading Timeout property
Show Root
Show Root
Show Root
Specifies whether the data in the top-level table is displayed in the tree component. This property is TRUE by default.
TRUE
The tree component displays as its top level the nodes named in the table that is used as the Table property.
FALSE
The tree component displays as its top level the children of the first row of the table that is used as the Table property. The other rows from the top-level table are not displayed.
A tree with the Show Root property set to TRUE (left) and FALSE (right)
The Show Root property
Max Depth
Max Depth
Max Depth
An integer that specifies the maximum level of tree descendants that are allowed. A value of 0 allows an unlimited number of levels. A value of 1 allows only one level of nodes and does not allow any descendants to be loaded.
The Max Depth property
Load All Nodes
Load All Nodes
Load All Nodes
A boolean value that indicates whether to pre-load children for the tree. This value is FALSE by default.
TRUE
All children are loaded when the page is first loaded, when the data table is first set, or when this property becomes TRUE.
FALSE
Children of a node are loaded only when requested, for example when a user clicks the disclosure icon.
The Load All Nodes property
Expand All Nodes
Expand All Nodes
Expand All Nodes
This property is visible only when Load All Nodes is TRUE. It determines whether to expand all nodes after they are loaded.
The Expand All Nodes property
Show Loading Indicator
Show Loading Indicator
Show Loading Indicator
Determines whether to disaply a visual signal when an attempt is being made to load tree nodes.
An example of the loading indicator
The Show Loading Indicator property
Select Node
Select Node
Select Node
A node ID that specifies a loaded node to select, expand, and make visible. Only works if the tree's Selection Behavior is set to a value other than None.
If the specified node is not loaded, this property does nothing. You can use this property together with the Load All Nodes property and the onAllNodesLoaded event property in the Advanced properties, to ensure that all nodes are loaded before this property's value is set.
If a node with the specified ID exists in more than one table, then the first node with this ID that is encountered is used.
For selection of more than one node, use the Selected Items property in the Selection properties. However, Selected Items controls selection only, not which nodes are expanded.
The Select Node property
Disclosure Icon Color
Disclosure Icon Color
Disclosure Icon Color
A color to be used for the default "expand" and "collapse," or "open" and "close," icons for a node that has children and is not currently selected.
A tree with a black Disclosure Icon Color and a white Disclosure Icon Selected Color
The Disclosure Icon Color property
Disclosure Icon Selected Color
Disclosure Icon Selected Color
Disclosure Icon Selected
A color to be used for the default "expand" and "collapse," or "open" and "close," icons for a node that has children and is currently selected. Only works if selection is enabled for this tree.
A tree with a black Disclosure Icon Color and a white Disclosure Icon Selected Color
The Disclosure Icon Selected Color property
Open Icon
Open Icon
Open Icon
An image to be used as the "expand," or "open," icon for a node that has children, is currently closed, and is not currently selected.
A tree with a triangle SVG used as the Open Icon property
The Open Icon property
Open Icon Selected
Open Icon Selected
Open Icon Selected
An image to be used as the "expand," or "open," icon for a node that has children, is currently closed, and is currently selected. Only works if selection is enabled for this tree.
A tree with a gray triangle SVG used as the Open Icon Selected property
The Open Icon Selected property
Close Icon
Close Icon
Close Icon
An image to be used as the "collapse," or "close," icon for a node that has children, is currently open, and is not currently selected.
A tree with a black triangle SVG used as the Close Icon property
The Close Icon property
Close Icon Selected
Close Icon Selected
Close Icon Selected
An image to be used as the "collapse," or "close," icon for a node that has children, is currently open, and is currently selected. Only works if selection is enabled for this tree.
A tree with a gray triangle SVG used as the Close Icon Selected property
The Close Icon Selected property
Tree Items Properties
These properties affect the visual formatting of the tree.
Tree Items Text and Font Properties
The Text and Font properties for tree items are similar to those for Text components.
Tree Items Lines Properties
The Lines properties for tree items affect the lines that connect tree items.
A tree with the Lines properties set as a black dotted line.
Lines Stroke Color
Lines Stroke Color
Lines Stroke Color
Defines the color used for lines in the tree.
The Lines Stroke Color property
Lines Stroke Style
Lines Stroke Style
Lines Stroke Style
Defines whether lines in the tree are solid or dotted lines.
The Lines Stroke Style property
Lines Stroke Weight
Lines Stroke Weight
Lines Stroke Weight
Defines the stroke weight used for lines in the tree.
The Lines Stroke Weight property
Tree Items Fill Properties
Tree items fill properties affect the types of rows listed in this table.
Property
Description
Main Rows
The first group of alternating rows.
Alternate Rows
The second group of alternating rows.
Hovered Row
The row that the user mouses over.
Focused Row
The row that is in focus.
Selected Rows
The selected rows. Only works if selection is enabled for this tree.
The Tree Items Fill properties
Tree Items Position and Size Properties
Indent
Indent
Indent
Defines the number of pixels by which each level in the tree is indented. If an image is specified for the Open Item Icon and Close Item Icon properties, then Indent also controls the width of this image.
The Indent property
Item Height
Item Height
Item Height
Defines the height of each item in the tree, in pixels.