Unlevelled List
In an unlevelled list each entry tells the Tree View exactly where it fits in the tree structure by specifying its parent ID. At a minimum, an unlevelled list must contain columns with the following data:
Field
|
Tree View Property
|
Description
|
ID
|
list_id_field
|
A unique ID string to identify the entry.
|
Parent ID
|
list_parent_id_field
|
The ID string of the parent entry. An empty string indicates a top level entry.
|
Caption
|
list_caption_field
|
The text to display for the entry.
|
|
The Tree View processes the list entries in the supplied order and cannot add an entry to a parent that doesn't exist. It is your responsibility to ensure the list is sorted so that parent items come before their children and items at the same level are in display order. One way to do that is to add a depth column and a sequence column and sort the list by depth then sequence.
For example, a working list like this:
ID
|
Parent ID
|
Caption
|
1
|
|
Node A
|
2
|
|
Node B
|
3
|
1
|
Leaf A1
|
4
|
1
|
Leaf A2
|
5
|
2
|
Node B1
|
6
|
2
|
Leaf B2
|
7
|
5
|
Leaf B1A
|
8
|
5
|
Leaf B1B
|
|
Will produce a tree like this:
Note that, although the ID and ParentID columns contain numbers in this example, they must be text or character fields.
An unlevelled list can contain more columns that can be used to further customize the behavior or appearance of the corresponding entry.
Field
|
Tree View Property
|
Description
|
Image
|
list_image_field
|
Specifies a path, relative to the images directory, to an image to be used for the entry's icon.
|
Open image
|
list_open_image_field
|
Specifies a path, relative to the images directory, to an image to be used for the entry's icon when the entry is expanded.
|
Is Selected
|
list_is_selected_field
|
Indicates that the initial state of the entry is selected. This should be a string field that will contain either nothing (not selected) or one of two values: 'true' or 'freeze'. Both values indicate that the entry is selected but differ in how the Tree View behaves. If the value is 'true' the Tree View will perform whatever action it is configured to perform when a user clicks on the entry. In other words, it simulates the user selecting the entry. If the value is 'freeze' then the Tree View draws the item as selected but performs no other action.
|
Is Expanded
|
list_is_expanded_field
|
Indicates that the initial state of the entry is expanded. This is ignored if the entry does not have children. This field can be a string or a numeric. Values of 'true', 'y' or 1 are treated as true, all other values are treated as false.
|
OnSelect WAM OnSelect Webroutine
|
list_onselect_wamname_field
list_onselect_wrname_field
|
The name of a WAM/Webroutine that will be run when the item is clicked. If no value is supplied in these fields, the defaults specified by the onselect_wamname and onselect_wrname properties will be used.
|
|