If a search query is entered, only the following items are shown in the tree:
If a found item is a non-leaf — it is displayed expanded. If the non-leaf items contained within it match the search query or lead to a matching item, they are displayed expanded (otherwise collapsed). All items that are parents of the found item are displayed expanded.
Text matching the search query in the item name is highlighted in bold.
These behaviors are also available for tree select.
When to use
Used when nested items are a subset of their parents.
For example, in a hierarchical product category filter. When we search in coffee makers and toasters, we are actually searching within small kitchen appliances, which is itself a subcategory of home appliances in general.
How it works
The algorithm for this tree-select is the familiar 3-state checkbox behavior:
How to save to the model and select matcher
Ideal: Display in the select matcher and save to the model the minimum set of items — N-level items if not all are selected. And one N-1 level item if all N-level items are selected.
Acceptable: When selecting an N-1 level item, save all N-level items (all children) to the model. If N+1 level items exist, save those too.
An extension of this case is the folder/group access rights scenario (variant 3).
The second tree behavior algorithm — levels that are independent of each other.
When to use
All items are independent of each other, simply visually grouped in a tree.
For example, in a system where users can assign tags, and these tags can be organized into folders and subfolders. Assigning a child tag to an object does not mean the folder object should also be assigned. And conversely, assigning a folder tag has no effect on assigning a child tag.
How it works
No checkboxes affect each other.
How to save to the model and select matcher
Checked checkboxes are saved.
The third tree behavior variant is an extension of the "Child subcategories" variant.
When to use
When you need to assign access rights to a tree of objects. Both rules apply:
group 1.1 were granted first, then rights to group 1 were granted. If the system requires that the rights to 1.1 be preserved, this algorithm should be applied.How it works
Similar to the "Child subcategories" variant, but with one restriction. When a parent is selected, child items are not just checked — they are also disabled. Only what is explicitly checked is saved.
In addition, if an item was selected and then its parent was selected, the siblings of that item will be selected and disabled, while the explicitly selected item remains enabled. This indicates that a specific rule is set on it. If the checkbox on such an item is unchecked, it becomes disabled. To restore its explicit assignment, the parent's checkbox must be unchecked.
How to save to the model and select matcher
Only explicitly checked items are saved. Disabled items are not saved.
Clicking an item selects it and updates the information in the right panel. Clicking the checkbox marks the item, but the information in the right panel does not change.
The list can also be navigated with the keyboard. Enter selects an item and updates the text in the right panel, while Space marks it. The selected item changes along with navigation.
When navigating the list, the selected item does not change along with the focus position. An item can be selected by clicking or pressing Enter.
Clicking an element expands the first level of child nodes, only leaf elements can be selected.