tree class
A control that allows for selecting items from a hierarchical view of items.
Methods¶
__init__() ¶
__init__(
value=None,
expanded=True,
multiple=False,
select_leafs_only=False,
row_height=None,
label=None,
mode=None,
dropdown=False,
filter=False,
width="360px",
height=None,
lov=None,
adapter=None, # lambda x: str(x)
type=None, # Type name of the first lov element
value_by_id=False,
on_change=None,
propagate=None, # App config
active=True,
id=None,
properties=None,
class_name=None,
hover_text=None,
) -> None
Create a new tree
element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Any
|
Bound to the selection value. |
None
|
expanded |
Union[bool,list[str]]
|
If Boolean and False, only one node can be expanded at one given level. Otherwise this should be set to an array of the node identifiers that need to be expanded. |
True
|
multiple |
bool
|
If True, the user can select multiple items by holding the |
False
|
select_leafs_only |
bool
|
If True, the user can only select leaf nodes. |
False
|
row_height |
str
|
The height of each row of this tree, in CSS units. |
None
|
label |
str
|
The label associated with the selector when in dropdown mode. |
None
|
mode |
str
|
Define the way the selector is displayed:
|
None
|
dropdown |
bool
|
If True, the list of items is shown in a dropdown menu. |
False
|
filter |
bool
|
If True, this control is combined with a filter input area. |
False
|
width |
Union[str, int]
|
The width of this selector, in CSS units. |
360px
|
height |
Union[str, int]
|
The height of this selector, in CSS units. |
None
|
lov |
dict[str, Any]
|
The list of values. See the section on List of Values for more details. |
None
|
adapter |
Union[str, Callable]
|
A function or the name of the function that transforms an element of lov into a tuple(id:str, label:Union[str,Icon]). |
lambda x: str(x)
|
type |
str
|
This property is required if lov contains a non-specific type of data (e.g., a dictionary).
The default value is the type of the first element in lov. |
Type name of the first lov element
|
value_by_id |
bool
|
If False, the selection value (in value) is the selected element in lov. If set to True, then value is set to the id of the selected element in lov. |
False
|
on_change |
Union[str, Callable]
|
A function or the name of a function that is triggered when the value is updated.
|
None
|
propagate |
bool
|
Allows the control's main value to be automatically propagated. |
App config
|
active |
bool
|
Indicates if this component is active. |
True
|
id |
str
|
The identifier that is assigned to the rendered HTML component. |
None
|
properties |
dict[str, Any]
|
Bound to a dictionary that contains additional properties for this element. |
None
|
class_name |
str
|
The list of CSS class names that are associated with the generated HTML Element. |
None
|
hover_text |
str
|
The information that is displayed when the user hovers over this element. |
None
|