Make node selection in ui.tree optional, improve access to node collections #2014
falkoschindler
started this conversation in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In #1924 (comment) we noticed that
ui.tree
toggles node selection when clicking on a label, even though a QTree usually toggles expansion in this case. Only if the "selected" prop is set, clicking a node label will toggle its selection instead. But sinceui.tree
always sets "selected" to an empty list when initialized, the user can't expand nodes by clicking on their labels.A workaround is to remove the "selected" prop:
It would be nice to be able to configure the behavior via parameters, e.g.
selection: bool = True
.While at it we could also think about public access to the current list of selected, expanded and ticked nodes. This could be done very similar to
ui.table
:nicegui/nicegui/elements/table.py
Lines 139 to 147 in 2874555
Beta Was this translation helpful? Give feedback.
All reactions