pub struct DataTable { /* private fields */ }Expand description
DataTable widget for displaying tabular data.
Implementations§
Source§impl DataTable
impl DataTable
Sourcepub fn column(self, column: TableColumn) -> Self
pub fn column(self, column: TableColumn) -> Self
Add a column.
Sourcepub fn columns(self, columns: impl IntoIterator<Item = TableColumn>) -> Self
pub fn columns(self, columns: impl IntoIterator<Item = TableColumn>) -> Self
Add multiple columns.
Sourcepub fn rows(self, rows: impl IntoIterator<Item = TableRow>) -> Self
pub fn rows(self, rows: impl IntoIterator<Item = TableRow>) -> Self
Add multiple rows.
Sourcepub fn row_height(self, height: f32) -> Self
pub fn row_height(self, height: f32) -> Self
Set row height.
Sourcepub fn header_height(self, height: f32) -> Self
pub fn header_height(self, height: f32) -> Self
Set header height.
Sourcepub const fn selectable(self, selectable: bool) -> Self
pub const fn selectable(self, selectable: bool) -> Self
Enable row selection.
Sourcepub const fn row_alt_bg(self, color: Color) -> Self
pub const fn row_alt_bg(self, color: Color) -> Self
Set alternate row background color.
Sourcepub const fn selected_bg(self, color: Color) -> Self
pub const fn selected_bg(self, color: Color) -> Self
Set selected row background color.
Sourcepub const fn text_color(self, color: Color) -> Self
pub const fn text_color(self, color: Color) -> Self
Set text color.
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
Set the accessible name.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get column count.
Sourcepub fn get_columns(&self) -> &[TableColumn]
pub fn get_columns(&self) -> &[TableColumn]
Get columns.
Sourcepub const fn get_selected_row(&self) -> Option<usize>
pub const fn get_selected_row(&self) -> Option<usize>
Get selected row index.
Sourcepub fn get_sort_column(&self) -> Option<&str>
pub fn get_sort_column(&self) -> Option<&str>
Get current sort column.
Sourcepub const fn get_sort_direction(&self) -> SortDirection
pub const fn get_sort_direction(&self) -> SortDirection
Get current sort direction.
Sourcepub fn select_row(&mut self, index: Option<usize>)
pub fn select_row(&mut self, index: Option<usize>)
Select a row.
Sourcepub fn set_sort(&mut self, column: impl Into<String>, direction: SortDirection)
pub fn set_sort(&mut self, column: impl Into<String>, direction: SortDirection)
Set sort column and direction.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataTable
impl<'de> Deserialize<'de> for DataTable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Widget for DataTable
impl Widget for DataTable
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints. Read more
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds. Read more
Source§fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
Handle input events. Read more
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl Freeze for DataTable
impl RefUnwindSafe for DataTable
impl Send for DataTable
impl Sync for DataTable
impl Unpin for DataTable
impl UnwindSafe for DataTable
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