1.Dependencies
In order to use GTree in your project all you need to do is include "GTree" in the dependencies, this will automatically include structures neeeded.
2.Input Parameters
The tree has 3 input parameters :
2.1 AllNodesList
A list of Node .
This is the list representing your tree. Since outsystems does not support recursive structures this should be a tree represented in the form of a list, meaning each item needs at least the NodeId and ParentNodeId defined for defining the tree aspect and the NodeName for display purposes.
2.1.1 Node
Node is a structure with the following attributes
2.2 TreeSettings
This structure defines tree settings, it's attributes are:
2.3 FilterSettings
This parameter controll wether or not to display a filter and it's aditional features. It's attributes are:
3.Events
The tree triggers the NodesChecked event everytime you select a node. That event payload is a a list of Node.
This is the list of ALL checked nodes after checking/unchecking a node. This has to be a list because if you select a node with children it will automatically select all children, and thus it will be easier to handle it that way.
Demo - Intro
This version is relative to the demo of the component.
For full documentation of the Gtree usage and available actions please refer to the previous documentantion.
Following is a brief explanation of each screen and what use cases are included.
DefaultTree
This is the way GTree is rendered by default.
CustomizedTree
Gtree is customizable , There are a couple of parameters that can be passed to it to allow some customization.
FilterTree
By default the option to filter is disabled, but it's possible to enable it. This search allows the user to filter a tree by the node name.By doing it so, you can also define some aditionnal parameters.Hide Leafs: It is possible to hide the leafs that doesn't match the search criteria, by doing that the tree checkbox will be automatically set to "simple check".Buttons: If buttons are hidden Enter also triggers the search
OnCheckedEvent
LargeTree
Gtree is optimized and will only render the visible nodes.In this example it is loading a 5000 nodes tree.