pub struct Table { /* private fields */ }Expand description
A data table widget with column headers, row selection, and keyboard navigation.
Implementations§
Source§impl Table
impl Table
Sourcepub fn cursor_type(self, ct: CursorType) -> Self
pub fn cursor_type(self, ct: CursorType) -> Self
Sets the cursor type (Row or Cell).
Sourcepub fn fixed_rows(self, n: usize) -> Self
pub fn fixed_rows(self, n: usize) -> Self
Sets the number of fixed (non-scrolling) rows at the top.
Sourcepub fn column_highlight_style(self, style: Style) -> Self
pub fn column_highlight_style(self, style: Style) -> Self
Sets the column highlight style (applied to the selected column).
Sourcepub fn cell_highlight_style(self, style: Style) -> Self
pub fn cell_highlight_style(self, style: Style) -> Self
Sets the cell highlight style (highest priority highlight).
Sourcepub fn selected_column(&self) -> usize
pub fn selected_column(&self) -> usize
Returns the selected column index.
Sourcepub fn columns(self, columns: Vec<TableColumn>) -> Self
pub fn columns(self, columns: Vec<TableColumn>) -> Self
Sets the column definitions.
Sourcepub fn rows_simple(self, rows: Vec<Vec<impl Into<TableCell>>>) -> Self
pub fn rows_simple(self, rows: Vec<Vec<impl Into<TableCell>>>) -> Self
Convenience: construct rows from Vec<Vec<impl Into
Sets a footer row displayed below all data rows.
Sourcepub fn header_style(self, style: Style) -> Self
pub fn header_style(self, style: Style) -> Self
Sets the header row style.
Sourcepub fn select_style(self, style: Style) -> Self
pub fn select_style(self, style: Style) -> Self
Sets the selected row style.
Sourcepub fn set_selected(&mut self, index: usize, cx: &mut EventCx<'_>)
pub fn set_selected(&mut self, index: usize, cx: &mut EventCx<'_>)
Sets the selected row programmatically.
Sourcepub fn sort_by_column(&mut self, col: usize, cx: &mut EventCx<'_>)
pub fn sort_by_column(&mut self, col: usize, cx: &mut EventCx<'_>)
Sorts rows by the given column index, in ascending order. Invalid column index is a no-op.
Sourcepub fn set_column_width(&mut self, col: usize, width: u16, cx: &mut EventCx<'_>)
pub fn set_column_width(&mut self, col: usize, width: u16, cx: &mut EventCx<'_>)
Sets the width of a specific column. Minimum width is 3.
Sourcepub fn adjust_column_width(
&mut self,
col: usize,
delta: i16,
cx: &mut EventCx<'_>,
)
pub fn adjust_column_width( &mut self, col: usize, delta: i16, cx: &mut EventCx<'_>, )
Adjusts the width of a column by delta (positive = wider).