Trees
A tree is a way to display data. It is formed from entities.
-
Create an entity from three fields (see more details in Creating a table, Creating a view, Creating a projection):
- field 1 - primary key;
- field 2 - names of tree elements;
- field 3 - element’s parent key.
-
On field 3 set the foreign key from field 1 (see more details in Installing a foreign key).
-
Fill in the entity data.
-
Add a menu item for the entity (see more details in Adding a menu item). In the “Style” field, specify the value “treedetailed”.
In the tree with classifiers, in addition to nesting, criteria and classes are created.
Criterion - a sign for evaluating something. The criterion allows you to select classes and classify subjects according to them. The classification criterion “color” can be divided into classes: red, blue, yellow.
-
Create two entities (see more details in Creating a table, Creating a view, Creating a projection).
Entity 1:
- field 1 - primary key;
- field 2 - names of tree elements;
- field 3 - key ancestor of the element;
- field 4 - foreign key of entity 2 (added after creating of entities 2).
Entity 2:
- field 5 - primary key;
- field 6 - names of criteria;
- field 7 - foreign key of entity 1.
-
On field 3 set the foreign key from * field 1 * (see more details in Installing a foreign key.
-
On field 4 set foreign key from field 5 (see more details in Installing a foreign key.
-
On field 7 set the foreign key from field 1 (see more details in Installing a foreign key.
If there are several foreign keys or they are not explicitly specified: specify the parent, left and right keys.
-
Go to [Selected entity] > button [More] > the button [Setup…].
-
In the detailed form, click [Edit] to switch to edit mode.
-
Enter in the field “Additional parameters” :
{ "parent_property": "a", "left_key_property": "b", "right_key_property": "c" }
Parameters can be specified selectively.
Instead of a, b and c, enter:
- instead of “a” - a field containing the parent keys;
- instead of “b” - a field containing the left key;
- instead of “c” - a field containing the right key.
Learn more about nested sets in Nested set model.
-
Click the button [Save] to save changes or click [Cancel] to exit the edit mode without saving.