pub struct TableRow<T> { /* private fields */ }Expand description
Typed row ID, ordered cells, visual selection, availability, and leading icon.
Row IDs need not be unique. The per-row selected binding is visual only;
table-level controlled selection compares IDs and may therefore select every
duplicate ID visually.
§Examples
use ailloli_ui_widgets::controls::{TableCell, TableRow};
let row = TableRow::new(7).cell(TableCell::text("Seven"));
assert_eq!(*row.id(), 7);Implementations§
Source§impl<T> TableRow<T>
impl<T> TableRow<T>
Sourcepub fn new(id: T) -> Self
pub fn new(id: T) -> Self
Creates an enabled, visually unselected row with no cells or icon.
§Examples
use ailloli_ui_widgets::controls::TableRow;
let row = TableRow::new("row-id");
assert_eq!(row.id(), &"row-id");Sourcepub fn cell(self, cell: TableCell) -> Self
pub fn cell(self, cell: TableCell) -> Self
Appends one cell in column order.
§Examples
use ailloli_ui_widgets::controls::{TableCell, TableRow};
let row = TableRow::new(1).cell(TableCell::text("One"));
assert_eq!(row.cells_ref().len(), 1);Sourcepub fn cells(self, cells: impl IntoIterator<Item = TableCell>) -> Self
pub fn cells(self, cells: impl IntoIterator<Item = TableCell>) -> Self
Extends cells in iterator order without clearing existing cells.
§Examples
use ailloli_ui_widgets::controls::{TableCell, TableRow};
let row = TableRow::new(1).cells([TableCell::text("One"), TableCell::muted("Aux")]);
assert_eq!(row.cells_ref().len(), 2);Sourcepub fn selected(self, selected: impl Into<Binding<bool>>) -> Self
pub fn selected(self, selected: impl Into<Binding<bool>>) -> Self
Sets an independent static or reactive visual-selection flag.
This does not update TableView::selected or invoke selection callbacks.
§Examples
use ailloli_ui_widgets::controls::TableRow;
let row = TableRow::new(1).selected(true);
let _ = row;Sourcepub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
pub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
Sets static or reactive row-disabled state.
Disabled rows use reduced opacity and are skipped by hit testing and keyboard navigation.
§Examples
use ailloli_ui_widgets::controls::TableRow;
let row = TableRow::new(1).disabled(true);
let _ = row;Sourcepub fn disabled_signal(self, disabled: Memo<bool>) -> Self
pub fn disabled_signal(self, disabled: Memo<bool>) -> Self
Uses a memo as the reactive row-disabled binding.
§Examples
use ailloli_ui_runtime::component::Memo;
use ailloli_ui_widgets::controls::TableRow;
let row = TableRow::new(1).disabled_signal(Memo::new(|| false));
let _ = row;Sourcepub fn leading_icon(self, icon: IconId) -> Self
pub fn leading_icon(self, icon: IconId) -> Self
Sets the first-column leading icon, replacing any previous one.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::controls::TableRow;
let row = TableRow::new(1).leading_icon(IconId::History);
let _ = row;Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TableRow<T>where
T: Freeze,
impl<T> !RefUnwindSafe for TableRow<T>
impl<T> !Send for TableRow<T>
impl<T> !Sync for TableRow<T>
impl<T> Unpin for TableRow<T>where
T: Unpin,
impl<T> !UnwindSafe for TableRow<T>
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.