pub struct DataTableProps {Show 35 fields
pub columns: Vec<DataTableColumn>,
pub rows: Vec<DataTableRow>,
pub sorting: Option<Vec<DataTableSort>>,
pub default_sorting: Vec<DataTableSort>,
pub default_sort: Option<DataTableSort>,
pub on_sorting_change: Option<EventHandler<Vec<DataTableSort>>>,
pub on_sort_change: Option<EventHandler<Option<DataTableSort>>>,
pub sort_mode: DataTableSortMode,
pub multi_sort: bool,
pub sort_priority_label: Option<Callback<(usize, DataTableSortDirection), String>>,
pub selectable: bool,
pub selected_row_ids: Option<Vec<String>>,
pub default_selected_row_ids: Vec<String>,
pub on_selected_row_ids_change: Option<EventHandler<Vec<String>>>,
pub select_all_label: Option<String>,
pub select_row_label: Option<String>,
pub name: Option<String>,
pub get_row_label: Option<Callback<DataTableRow, String>>,
pub layout: TableLayout,
pub sticky_header: Option<bool>,
pub loading: bool,
pub loading_label: Option<String>,
pub loading_rows: usize,
pub empty: Option<Element>,
pub render_details: Option<Callback<DataTableRow, Element>>,
pub expanded_row_ids: Option<Vec<String>>,
pub default_expanded_row_ids: Vec<String>,
pub on_expanded_row_ids_change: Option<EventHandler<Vec<String>>>,
pub expand_label: Option<String>,
pub collapse_label: Option<String>,
pub details_label: Option<String>,
pub glass: Glass,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
pub children: Element,
}Expand description
Props for DataTable.
Fields§
§columns: Vec<DataTableColumn>Columns. Without valid columns (non-empty, unique keys) the table renders its children.
rows: Vec<DataTableRow>Records. Rows with duplicate or empty ids render no rows.
sorting: Option<Vec<DataTableSort>>Controlled sort criteria; the first entry is the primary sort.
default_sorting: Vec<DataTableSort>Initial criteria when uncontrolled.
default_sort: Option<DataTableSort>Initial single criterion when uncontrolled and default_sorting is empty.
on_sorting_change: Option<EventHandler<Vec<DataTableSort>>>Called with the criteria after a header activation.
on_sort_change: Option<EventHandler<Option<DataTableSort>>>Called with the primary criterion when it changes.
sort_mode: DataTableSortModeWho sorts the rows.
multi_sort: boolShift+click or Shift+Enter on a header adds or reverses a secondary criterion.
sort_priority_label: Option<Callback<(usize, DataTableSortDirection), String>>Screen-reader text of a sort priority badge. Defaults to Sort priority {n}, {direction}.
selectable: boolRenders a leading checkbox column.
selected_row_ids: Option<Vec<String>>Controlled selected row ids.
default_selected_row_ids: Vec<String>Initially selected row ids when uncontrolled.
on_selected_row_ids_change: Option<EventHandler<Vec<String>>>Called with the selected row ids.
select_all_label: Option<String>Name of the select-all checkbox. Defaults to Select all rows.
select_row_label: Option<String>Prefix of each row checkbox name. Defaults to Select row.
name: Option<String>Form field name of the row checkboxes, so selected row ids submit with a form.
get_row_label: Option<Callback<DataTableRow, String>>Names a record in disclosure, selection, and details labels. Defaults to the first column.
layout: TableLayoutNarrow-width behavior.
sticky_header: Option<bool>Keeps the header row visible while rows scroll. Cap the height with the
--ui-table-max-height custom property (default 32rem) in style. The scrolling root
becomes a focusable region named Table unless you pass role, tabindex, aria_label
or aria_labelledby. Defaults to true inside a DataTableView, otherwise false.
loading: boolMarks the table busy and announces loading_label. Without rows, placeholder rows
render instead of the empty row.
loading_label: Option<String>Text of the table’s status region while loading. The region stays mounted and empty
otherwise, because screen readers can miss a live region inserted with its text. Defaults
to Loading rows.
loading_rows: usizePlaceholder rows while loading without rows, up to 100. Defaults to 3.
empty: Option<Element>Content of the row shown when there are no rows and the table is not loading. Defaults
to No records.
render_details: Option<Callback<DataTableRow, Element>>Renders an expandable details row for a record.
expanded_row_ids: Option<Vec<String>>Controlled expanded row ids.
default_expanded_row_ids: Vec<String>Initially expanded row ids when uncontrolled.
on_expanded_row_ids_change: Option<EventHandler<Vec<String>>>Called with the expanded row ids.
expand_label: Option<String>Prefix of the expand button name. Defaults to Expand record.
collapse_label: Option<String>Prefix of the collapse button name. Defaults to Collapse record.
details_label: Option<String>Prefix of the details region name. Defaults to Record details.
glass: GlassGlass intensity.
class: Option<String>Extra classes appended after the Lumen classes.
attributes: Vec<Attribute>Any other <div> or global attribute.
children: ElementA static table rendered when there are no valid columns.
Implementations§
Source§impl DataTableProps
impl DataTableProps
Sourcepub fn builder() -> DataTablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> DataTablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building DataTableProps.
On the builder, call .columns(...)(optional), .rows(...)(optional), .sorting(...)(optional), .default_sorting(...)(optional), .default_sort(...)(optional), .on_sorting_change(...)(optional), .on_sort_change(...)(optional), .sort_mode(...)(optional), .multi_sort(...)(optional), .sort_priority_label(...)(optional), .selectable(...)(optional), .selected_row_ids(...)(optional), .default_selected_row_ids(...)(optional), .on_selected_row_ids_change(...)(optional), .select_all_label(...)(optional), .select_row_label(...)(optional), .name(...)(optional), .get_row_label(...)(optional), .layout(...)(optional), .sticky_header(...)(optional), .loading(...)(optional), .loading_label(...)(optional), .loading_rows(...)(optional), .empty(...)(optional), .render_details(...)(optional), .expanded_row_ids(...)(optional), .default_expanded_row_ids(...)(optional), .on_expanded_row_ids_change(...)(optional), .expand_label(...)(optional), .collapse_label(...)(optional), .details_label(...)(optional), .glass(...)(optional), .class(...)(optional), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of DataTableProps.
Trait Implementations§
Source§impl Clone for DataTableProps
impl Clone for DataTableProps
Source§impl PartialEq for DataTableProps
impl PartialEq for DataTableProps
Source§impl Properties for DataTablePropswhere
Self: Clone,
impl Properties for DataTablePropswhere
Self: Clone,
Source§type Builder = DataTablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = DataTablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for DataTableProps
Auto Trait Implementations§
impl !Freeze for DataTableProps
impl !RefUnwindSafe for DataTableProps
impl !Send for DataTableProps
impl !Sync for DataTableProps
impl !UnwindSafe for DataTableProps
impl Forget for DataTableProps
impl Move for DataTableProps
impl Unpin for DataTablePropswhere
*const u8 is !null: Unpin,
&'static UnsyncStorage: Unpin,
NonZero<u64>: Unpin,
&'static Location<'static>: Unpin,
Box<dyn FnMut((DataTableCell, DataTableRow)) -> Result<VNode, RenderError>>: Unpin,
*const RcInner<Runtime> is !null: Unpin,
Box<dyn FnMut(Vec<DataTableSort>)>: Unpin,
Box<dyn FnMut(Option<DataTableSort>)>: Unpin,
Box<dyn FnMut((usize, DataTableSortDirection)) -> String>: Unpin,
Box<dyn FnMut(Vec<String>)>: Unpin,
Box<dyn FnMut(DataTableRow) -> String>: Unpin,
Rc<VNodeInner>: Unpin,
Arc<Error>: Unpin,
NonZero<u32>: Unpin,
Box<dyn FnMut(DataTableRow) -> Result<VNode, RenderError>>: Unpin,
&'static str: Unpin,
Rc<RefCell<dyn FnMut(Event<dyn Any>)>>: Unpin,
Rc<dyn AnyValue>: Unpin,
impl UnsafeUnpin for DataTablePropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<DataTableColumn>: UnsafeUnpin,
PhantomData<DataTableRow>: UnsafeUnpin,
PhantomData<DataTableSort>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<Vec<DataTableSort>, ()>>>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<Option<DataTableSort>, ()>>>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<(usize, DataTableSortDirection), String>>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<Vec<String>, ()>>>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<DataTableRow, String>>>: UnsafeUnpin,
*const RcInner<VNodeInner> is !null: UnsafeUnpin,
PhantomData<RcInner<VNodeInner>>: UnsafeUnpin,
*const ArcInner<Error> is !null: UnsafeUnpin,
PhantomData<ArcInner<Error>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<DataTableRow, Result<VNode, RenderError>>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more