TREE item type

Defines a tree view widget.

Note:

This topic covers the TREE item type definition in form files. See also the chapter dedicated to tree view programming.

TREE item basics

A TREE form item type defines a tree view to show a structured tree of data records with an optional set of columns.

The TREE basically acts like a TABLE container, in the sense of its function as a record list container. A TREE container renders as a tree view widget, with regular table columns on the right of the tree view.

A TREE is controlled by a DISPLAY ARRAY dialog, see List dialogs for more details about this type of dialog.

Defining a TREE

The TREE form item defines a tree view widget to show a structured set of data records. It is bound to a screen array grouping form fields which define the columns of the tree view.

The screen array definition must have exactly the same number of columns as the TREE form item. Use PHANTOM fields, if the number of record members in the program array exceeds the number of columns to be displayed in the TREE container.

TREE container definitions are very similar to regular TABLE containers; before reading further about tree views, you may need to familiarize yourself with TABLE containers.

The first column in the TREE must be the field defining the text of the tree view nodes.

Column titles can be defined with static labels in the TREE layout. However, this prevents you from localizing the column text. Consider using the TITLE attribute in the form field definition corresponding to the table columns.

Front-ends support different presentation and behavior options, which can be controlled by a STYLE attribute. For more details, see Style attributes common to all elements and Tree style attributes.

Where to use a TREE

A TREE form item can be defined in different ways:
  1. As a TREE container in a LAYOUT tree.
  2. As a <TREE > layout tag with a TREE item definition in the ATTRIBUTES section.

Defining the TREE layout and size

The number of field columns composing the TREE container in the form layout defines the initial width of the tree view.

The width of a TREE container is by default defined by the number of visible columns in its layout, and the initial height is defined by the number of rows. To specify explicitly the width and height of a tree view, use the WIDTH and HEIGHT attributes.

Tree view columns can be moved around, their width can be adapted, they can be hidden/shown, and can be selected to sort the record list automatically. To turn off these features, use respectively the UNMOVABLECOLUMNS, UNSIZABLECOLUMNS, UNHIDABLECOLUMNS and UNSORTABLECOLUMNS attributes.

TREE colums can be made stretchable, by combining the STRETCHCOLUMNS, STRETCH={X|NONE}, STRETCHMIN and STRETCHMAX attributes.

For more details, see also Controlling table rendering.