pub struct Table {
pub key_map: KeyMap,
pub styles: Styles,
pub mouse_wheel_enabled: bool,
pub mouse_wheel_delta: usize,
pub mouse_click_enabled: bool,
/* private fields */
}Expand description
Table model for displaying tabular data with keyboard navigation.
Fields§
§key_map: KeyMapKey bindings for navigation.
styles: StylesStyles for rendering.
mouse_wheel_enabled: boolWhether mouse wheel scrolling is enabled.
mouse_wheel_delta: usizeNumber of rows to scroll per mouse wheel tick.
mouse_click_enabled: boolWhether mouse click selection is enabled.
Implementations§
Source§impl Table
impl Table
Sourcepub fn with_styles(self, styles: Styles) -> Self
pub fn with_styles(self, styles: Styles) -> Self
Sets the styles (builder pattern).
Sourcepub fn with_key_map(self, key_map: KeyMap) -> Self
pub fn with_key_map(self, key_map: KeyMap) -> Self
Sets the key map (builder pattern).
Sourcepub fn mouse_wheel(self, enabled: bool) -> Self
pub fn mouse_wheel(self, enabled: bool) -> Self
Enables or disables mouse wheel scrolling (builder pattern).
Sourcepub fn mouse_wheel_delta(self, delta: usize) -> Self
pub fn mouse_wheel_delta(self, delta: usize) -> Self
Sets the number of rows to scroll per mouse wheel tick (builder pattern).
Sourcepub fn mouse_click(self, enabled: bool) -> Self
pub fn mouse_click(self, enabled: bool) -> Self
Enables or disables mouse click row selection (builder pattern).
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Returns whether the table is focused.
Sourcepub fn get_columns(&self) -> &[Column]
pub fn get_columns(&self) -> &[Column]
Returns the columns.
Sourcepub fn set_columns(&mut self, columns: Vec<Column>)
pub fn set_columns(&mut self, columns: Vec<Column>)
Sets the columns.
Sourcepub fn set_height(&mut self, h: usize)
pub fn set_height(&mut self, h: usize)
Sets the height.
Sourcepub fn get_height(&self) -> usize
pub fn get_height(&self) -> usize
Returns the viewport height.
Sourcepub fn selected_row(&self) -> Option<&Row>
pub fn selected_row(&self) -> Option<&Row>
Returns the currently selected row, if any.
Sourcepub fn set_cursor(&mut self, n: usize)
pub fn set_cursor(&mut self, n: usize)
Sets the cursor position.
Sourcepub fn goto_bottom(&mut self)
pub fn goto_bottom(&mut self)
Moves to the last row.
Sourcepub fn from_values(&mut self, value: &str, separator: &str)
pub fn from_values(&mut self, value: &str, separator: &str)
Parses rows from a string value with the given separator.