pub struct DataTableProps<T: Clone + PartialEq + 'static> {Show 18 fields
pub columns: Vec<TableColumn<T>>,
pub data: Vec<T>,
pub key_extractor: fn(&T) -> String,
pub selectable: bool,
pub selected_keys: Vec<String>,
pub on_selection_change: Option<EventHandler<Vec<String>>>,
pub on_row_click: Option<EventHandler<T>>,
pub empty_message: &'static str,
pub loading: bool,
pub style: Option<String>,
pub search_placeholder: &'static str,
pub search_query: Option<String>,
pub on_search_change: Option<EventHandler<String>>,
pub filters: Vec<TableFilter>,
pub active_filters: HashMap<String, String>,
pub on_filter_change: Option<EventHandler<(String, String)>>,
pub show_search: bool,
pub show_filters: bool,
}Expand description
Table properties
Fields§
§columns: Vec<TableColumn<T>>Column definitions
data: Vec<T>Table data
key_extractor: fn(&T) -> StringUnique key extractor for rows
selectable: boolRow selection enabled
selected_keys: Vec<String>Selected row keys
on_selection_change: Option<EventHandler<Vec<String>>>Selection change handler
on_row_click: Option<EventHandler<T>>Row click handler
empty_message: &'static strEmpty state message
loading: boolLoading state
style: Option<String>Custom inline styles
search_placeholder: &'static strSearch placeholder text
search_query: Option<String>Search query for filtering
on_search_change: Option<EventHandler<String>>Search change handler
filters: Vec<TableFilter>Custom filter definitions
active_filters: HashMap<String, String>Active filter values
on_filter_change: Option<EventHandler<(String, String)>>Filter change handler
show_search: boolShow search input
show_filters: boolShow filter controls
Implementations§
Source§impl<T: Clone + PartialEq + 'static> DataTableProps<T>
impl<T: Clone + PartialEq + 'static> DataTableProps<T>
Sourcepub fn builder() -> DataTablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ()), T>
pub fn builder() -> DataTablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ()), T>
Create a builder for building DataTableProps.
On the builder, call .columns(...), .data(...), .key_extractor(...), .selectable(...)(optional), .selected_keys(...)(optional), .on_selection_change(...)(optional), .on_row_click(...)(optional), .empty_message(...)(optional), .loading(...)(optional), .style(...)(optional), .search_placeholder(...)(optional), .search_query(...)(optional), .on_search_change(...)(optional), .filters(...)(optional), .active_filters(...)(optional), .on_filter_change(...)(optional), .show_search(...)(optional), .show_filters(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of DataTableProps.
Trait Implementations§
Source§impl<T: Clone + Clone + PartialEq + 'static> Clone for DataTableProps<T>
impl<T: Clone + Clone + PartialEq + 'static> Clone for DataTableProps<T>
Source§fn clone(&self) -> DataTableProps<T>
fn clone(&self) -> DataTableProps<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more