pub struct TableWidget { /* private fields */ }Expand description
Fluent builder for a compact dashboard table widget (e.g. “Recent Orders”).
Implementations§
Source§impl TableWidget
impl TableWidget
Sourcepub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
A table with an id that is unique on the dashboard, and a title. It spans the dashboard’s
full width unless you set col_span.
Sourcepub fn subtitle(self, subtitle: impl Into<String>) -> Self
pub fn subtitle(self, subtitle: impl Into<String>) -> Self
Adds a line under the table’s title.
Sourcepub fn action(self, label: impl Into<String>, href: impl Into<String>) -> Self
pub fn action(self, label: impl Into<String>, href: impl Into<String>) -> Self
Adds a link beside the title, such as View all, to a path inside the panel.
Sourcepub fn column(
self,
key: impl Into<String>,
label: impl Into<String>,
align: ColumnAlign,
) -> Self
pub fn column( self, key: impl Into<String>, label: impl Into<String>, align: ColumnAlign, ) -> Self
Adds a column. key names the cell of each row that the column shows.
Sourcepub fn badge_column(
self,
key: impl Into<String>,
label: impl Into<String>,
colors: impl IntoIterator<Item = (String, BadgeColor)>,
) -> Self
pub fn badge_column( self, key: impl Into<String>, label: impl Into<String>, colors: impl IntoIterator<Item = (String, BadgeColor)>, ) -> Self
Adds a column that shows its cells as badges, colored by their value.
Sourcepub fn row(
self,
key: impl Into<String>,
href: Option<String>,
cells: BTreeMap<String, Value>,
) -> Self
pub fn row( self, key: impl Into<String>, href: Option<String>, cells: BTreeMap<String, Value>, ) -> Self
Adds a row: a key that is unique in the table, an optional path inside the panel to open when the row is clicked, and the row’s cells by column key.
Sourcepub fn col_span(self, span: u8) -> Self
pub fn col_span(self, span: u8) -> Self
Sets how many of the dashboard’s four columns the table spans.
Sourcepub fn build(self) -> DashboardWidgetDto
pub fn build(self) -> DashboardWidgetDto
Finishes the widget.
Trait Implementations§
Source§impl Clone for TableWidget
impl Clone for TableWidget
Source§impl Debug for TableWidget
impl Debug for TableWidget
Source§impl From<TableWidget> for DashboardWidgetDto
impl From<TableWidget> for DashboardWidgetDto
Source§fn from(widget: TableWidget) -> Self
fn from(widget: TableWidget) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for TableWidget
impl Freeze for TableWidgetwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<TableWidgetColumnDto>: Freeze,
PhantomData<TableWidgetRowDto>: Freeze,
impl Move for TableWidget
impl RefUnwindSafe for TableWidget
impl Send for TableWidget
impl Sync for TableWidget
impl Unpin for TableWidget
impl UnsafeUnpin for TableWidgetwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TableWidgetColumnDto>: UnsafeUnpin,
PhantomData<TableWidgetRowDto>: UnsafeUnpin,
impl UnwindSafe for TableWidgetwhere
RawVecInner: UnwindSafe,
BTreeMap<String, BadgeColor>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
Converts
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> ⓘ
Converts
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