pub struct TableNav {
pub active_row: usize,
pub active_col: usize,
}Expand description
Keyboard navigation state — tracks the active (focused) cell.
Row and column indices here are visible indices (after filter / sort), not source indices. The caller is responsible for converting to source indices when fetching cell data.
Fields§
§active_row: usizeThe currently focused row in the visible (filtered/sorted) row set.
active_col: usizeThe currently focused column in the visible column order.
Implementations§
Sourcepub fn move_up(&mut self, total_rows: usize) -> bool
pub fn move_up(&mut self, total_rows: usize) -> bool
Move focus one row up. Returns true if the position changed.
Clamps at row 0; no-op when total_rows is zero.
Sourcepub fn move_down(&mut self, total_rows: usize) -> bool
pub fn move_down(&mut self, total_rows: usize) -> bool
Move focus one row down. Returns true if the position changed.
Clamps at total_rows - 1; no-op when total_rows is zero.
Sourcepub fn move_left(&mut self, total_cols: usize) -> bool
pub fn move_left(&mut self, total_cols: usize) -> bool
Move focus one column left. Returns true if the position changed.
Clamps at column 0; no-op when total_cols is zero.
Sourcepub fn move_right(&mut self, total_cols: usize) -> bool
pub fn move_right(&mut self, total_cols: usize) -> bool
Move focus one column right. Returns true if the position changed.
Clamps at total_cols - 1; no-op when total_cols is zero.
Sourcepub fn move_home_row(&mut self) -> bool
pub fn move_home_row(&mut self) -> bool
Move focus to the first visible row. Returns true if the position changed.
Sourcepub fn move_end_row(&mut self, total_rows: usize) -> bool
pub fn move_end_row(&mut self, total_rows: usize) -> bool
Move focus to the last visible row. Returns true if the position changed.
No-op when total_rows is zero.
Sourcepub fn page_up(&mut self, page_size: usize) -> bool
pub fn page_up(&mut self, page_size: usize) -> bool
Scroll focus up by page_size rows (Page Up).
Clamps at row 0. Returns true if the position changed.
Sourcepub fn page_down(&mut self, total_rows: usize, page_size: usize) -> bool
pub fn page_down(&mut self, total_rows: usize, page_size: usize) -> bool
Scroll focus down by page_size rows (Page Down).
Clamps at total_rows - 1. Returns true if the position changed.
No-op when total_rows is zero.
Sourcepub fn set_position(&mut self, row: usize, col: usize)
pub fn set_position(&mut self, row: usize, col: usize)
Set the active cell position explicitly (e.g. on mouse click).
Trait Implementations§
Auto Trait Implementations§
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,
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>
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>
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