pub struct TreeProps {Show 30 fields
pub tree_data: Option<Vec<TreeNode>>,
pub expanded_keys: Option<Vec<String>>,
pub default_expanded_keys: Option<Vec<String>>,
pub default_expand_all: bool,
pub auto_expand_parent: bool,
pub on_expand: Option<EventHandler<Vec<String>>>,
pub selected_keys: Option<Vec<String>>,
pub default_selected_keys: Option<Vec<String>>,
pub selectable: bool,
pub multiple: bool,
pub on_select: Option<EventHandler<Vec<String>>>,
pub checkable: bool,
pub checked_keys: Option<Vec<String>>,
pub default_checked_keys: Option<Vec<String>>,
pub check_strictly: bool,
pub on_check: Option<EventHandler<Vec<String>>>,
pub show_line: bool,
pub show_icon: bool,
pub block_node: bool,
pub disabled: bool,
pub draggable: Option<DraggableConfig>,
pub load_data: Option<Rc<dyn Fn(&TreeNode) -> Vec<TreeNode>>>,
pub field_names: Option<FieldNames>,
pub filter_tree_node: Option<Rc<dyn Fn(&TreeNode) -> bool>>,
pub icon: Option<Rc<dyn Fn(&TreeNode) -> Element>>,
pub switcher_icon: Option<Rc<dyn Fn(bool, bool) -> Element>>,
pub title_render: Option<Rc<dyn Fn(&TreeNode) -> Element>>,
pub loaded_keys: Option<Vec<String>>,
pub class: Option<String>,
pub style: Option<String>,
}Expand description
Props for the Tree component.
Fields§
§tree_data: Option<Vec<TreeNode>>Tree data source.
expanded_keys: Option<Vec<String>>Controlled expanded keys.
default_expanded_keys: Option<Vec<String>>Default expanded keys (uncontrolled mode).
default_expand_all: boolExpand all nodes by default.
auto_expand_parent: boolAuto expand parent nodes when children are expanded.
on_expand: Option<EventHandler<Vec<String>>>Callback when expand keys change.
selected_keys: Option<Vec<String>>Controlled selected keys.
default_selected_keys: Option<Vec<String>>Default selected keys (uncontrolled mode).
selectable: boolWhether nodes are selectable.
multiple: boolAllow multiple selection.
on_select: Option<EventHandler<Vec<String>>>Callback when selected keys change.
checkable: boolShow checkbox next to nodes.
checked_keys: Option<Vec<String>>Controlled checked keys.
default_checked_keys: Option<Vec<String>>Default checked keys (uncontrolled mode).
check_strictly: boolCheck strictly (parent and child are independent).
on_check: Option<EventHandler<Vec<String>>>Callback when checked keys change.
show_line: boolShow connecting lines between nodes.
show_icon: boolShow icon next to nodes.
block_node: boolBlock node (full-width clickable area).
disabled: boolDisable the entire tree.
draggable: Option<DraggableConfig>Enable drag and drop for tree nodes.
load_data: Option<Rc<dyn Fn(&TreeNode) -> Vec<TreeNode>>>Async load data function: (node) -> Vec
field_names: Option<FieldNames>Custom field names for tree data structure.
filter_tree_node: Option<Rc<dyn Fn(&TreeNode) -> bool>>Filter tree nodes: (node) -> bool
icon: Option<Rc<dyn Fn(&TreeNode) -> Element>>Custom icon render: (node) -> Element
switcher_icon: Option<Rc<dyn Fn(bool, bool) -> Element>>Custom switcher icon render: (expanded, is_leaf) -> Element
title_render: Option<Rc<dyn Fn(&TreeNode) -> Element>>Custom title render: (node) -> Element
loaded_keys: Option<Vec<String>>Loaded keys for async loading state.
class: Option<String>§style: Option<String>Implementations§
Source§impl TreeProps
impl TreeProps
Sourcepub fn builder() -> TreePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TreePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building TreeProps.
On the builder, call .tree_data(...)(optional), .expanded_keys(...)(optional), .default_expanded_keys(...)(optional), .default_expand_all(...)(optional), .auto_expand_parent(...)(optional), .on_expand(...)(optional), .selected_keys(...)(optional), .default_selected_keys(...)(optional), .selectable(...)(optional), .multiple(...)(optional), .on_select(...)(optional), .checkable(...)(optional), .checked_keys(...)(optional), .default_checked_keys(...)(optional), .check_strictly(...)(optional), .on_check(...)(optional), .show_line(...)(optional), .show_icon(...)(optional), .block_node(...)(optional), .disabled(...)(optional), .draggable(...)(optional), .load_data(...)(optional), .field_names(...)(optional), .filter_tree_node(...)(optional), .icon(...)(optional), .switcher_icon(...)(optional), .title_render(...)(optional), .loaded_keys(...)(optional), .class(...)(optional), .style(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TreeProps.