enhancement
major
#28593
Baumselektions-Modell mit Teilbaum-Selektionslogik
There should be a selection model for trees in which the selection of a node ensures that all nodes in the subtree are selected; if a node is selected, all nodes in this subtree are de-selected.
A node that is not a leaf node is selected when all nodes in the subtree are selected. Such a selection model is useful for trees in which only leaf nodes are actually relevant for the selection. Inner nodes are pure groupings whose selection itself has no technical relevance.
Implementation
- A new selection model TreeSelectionModel is introduced, which implements the semantics described above.
- The logic can be used in-app by adding an additional column with the column configuration "Tree selection column" to the configuration of tree tables or tree grids.
- In this column, the selection box "indeterminate" is displayed for a node that has both selected and unselected children.
Code migration
- Overrides of LayoutComponent.channels() must be changed to overrides of LayoutComponent.programmaticChannels().
- The class com.top_logic.element.layout.grid.GridComponent$DefaultMultiSelectionModelFactory has been dropped. Instead of referencing this class, you can simply set the option multiple="true".
Replace this
{{
<selectionModelFactory class="com.top_logic.element.layout.grid.GridComponent$DefaultMultiSelectionModelFactory"/>
}}}
by this
{{
<selectionModelFactory multiple="true"/>
}}}
Test
- There are examples in the demo:
- Technical demo > Components > Tables and trees > Tree table with tree selection
- Technical demo > Components > Tables and trees > Tree grid with tree selection
- TestTreeSelectionModel