pub struct DataTable<'a, Row, Key, Message> { /* private fields */ }data-table only.Expand description
A data table builder. Convert it into an Element to render.
Implementations§
Source§impl<'a, Row, Key, Message> DataTable<'a, Row, Key, Message>
impl<'a, Row, Key, Message> DataTable<'a, Row, Key, Message>
Sourcepub fn cell(
self,
column: ColumnId,
render: impl Fn(&'a Row) -> Element<'a, Message> + 'a,
) -> Self
pub fn cell( self, column: ColumnId, render: impl Fn(&'a Row) -> Element<'a, Message> + 'a, ) -> Self
Draws the cells of a column with render, such as a badge or a
progress bar, in place of its text. Keep it within a row’s height.
Sourcepub fn toolbar(self, toolbar: bool) -> Self
pub fn toolbar(self, toolbar: bool) -> Self
Shows the search box, column filters and Columns menu above the table. On by default.
Sourcepub fn placeholder(self, placeholder: impl Into<String>) -> Self
pub fn placeholder(self, placeholder: impl Into<String>) -> Self
The search box placeholder.
Sourcepub fn empty(self, message: impl Into<String>) -> Self
pub fn empty(self, message: impl Into<String>) -> Self
The message shown when no rows pass the search and filters.
Sourcepub fn height(self, height: impl Into<Length>) -> Self
pub fn height(self, height: impl Into<Length>) -> Self
A fixed or filling height scrolls the rows under the header. Defaults to shrinking to fit the page.
Sourcepub fn row_height(self, height: f32) -> Self
pub fn row_height(self, height: f32) -> Self
The height of each row, such as 32 for a compact table. Defaults to
ROW_HEIGHT. Custom cells must fit inside it.
Sourcepub fn breakpoint(self, width: f32) -> Self
pub fn breakpoint(self, width: f32) -> Self
The width below which rows become cards. Defaults to BREAKPOINT.
Sourcepub fn keymap(self, keymap: Keymap<Action>) -> Self
pub fn keymap(self, keymap: Keymap<Action>) -> Self
Replaces the default_keymap the focused table resolves keys with.
pub fn on_event(self, on_event: impl Fn(Event<Key>) -> Message + 'a) -> Self
Gives every row the context menu of menu, keyed by row key. It
opens on a right-click or a long press, and on the highlighted row
with its opening chord while the table has focus.
Replaces the context menu’s default keymap.
Sourcepub fn row_actions(self, row_actions: bool) -> Self
pub fn row_actions(self, row_actions: bool) -> Self
Adds a button at the end of each row that opens its context menu, for touch screens and anyone who does not right-click.
pub fn is_enabled(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'a, Row, Key, Message> !RefUnwindSafe for DataTable<'a, Row, Key, Message>
impl<'a, Row, Key, Message> !Send for DataTable<'a, Row, Key, Message>
impl<'a, Row, Key, Message> !Sync for DataTable<'a, Row, Key, Message>
impl<'a, Row, Key, Message> !UnwindSafe for DataTable<'a, Row, Key, Message>
impl<'a, Row, Key, Message> Freeze for DataTable<'a, Row, Key, Message>
impl<'a, Row, Key, Message> Unpin for DataTable<'a, Row, Key, Message>
impl<'a, Row, Key, Message> UnsafeUnpin for DataTable<'a, Row, Key, Message>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.