pub struct DataTableView {
pub visible_rows: Vec<usize>,
pub column_widths: Vec<u16>,
pub selected_row: usize,
pub selected_col: usize,
pub scroll_offset: usize,
pub horizontal_scroll: usize,
pub page_size: usize,
pub visible_col_start: usize,
pub visible_col_end: usize,
/* private fields */
}
Expand description
A view of a DataTable with presentation logic
Fields§
§visible_rows: Vec<usize>
Derived/cached view data
column_widths: Vec<u16>
§selected_row: usize
Navigation state
selected_col: usize
§scroll_offset: usize
§horizontal_scroll: usize
§page_size: usize
§visible_col_start: usize
§visible_col_end: usize
Implementations§
Source§impl DataTableView
impl DataTableView
Sourcepub fn get_datatable(&self) -> &DataTable
pub fn get_datatable(&self) -> &DataTable
V47: Get reference to DataTable (for BufferAPI compatibility)
Sourcepub fn get_datatable_mut(&mut self) -> &mut DataTable
pub fn get_datatable_mut(&mut self) -> &mut DataTable
V47: Get mutable reference to DataTable (for BufferAPI compatibility)
Sourcepub fn update_viewport(&mut self, terminal_width: u16, terminal_height: u16)
pub fn update_viewport(&mut self, terminal_width: u16, terminal_height: u16)
Update visible columns based on terminal width and height
Sourcepub fn visible_row_count(&self) -> usize
pub fn visible_row_count(&self) -> usize
Get visible row count after filtering
Sourcepub fn apply_filter(
&mut self,
pattern: String,
column_index: Option<usize>,
case_sensitive: bool,
)
pub fn apply_filter( &mut self, pattern: String, column_index: Option<usize>, case_sensitive: bool, )
Apply a filter to the view
Sourcepub fn clear_filter(&mut self)
pub fn clear_filter(&mut self)
Clear the current filter
Sourcepub fn apply_sort(&mut self, column_index: usize, order: SortOrder)
pub fn apply_sort(&mut self, column_index: usize, order: SortOrder)
Apply sorting to the view
Sourcepub fn clear_sort(&mut self)
pub fn clear_sort(&mut self)
Clear sorting
Sourcepub fn start_search(&mut self, pattern: String, case_sensitive: bool)
pub fn start_search(&mut self, pattern: String, case_sensitive: bool)
Start a search within the view
Sourcepub fn next_search_match(&mut self)
pub fn next_search_match(&mut self)
Navigate to next search match
Sourcepub fn prev_search_match(&mut self)
pub fn prev_search_match(&mut self)
Navigate to previous search match
Sourcepub fn clear_search(&mut self)
pub fn clear_search(&mut self)
Clear search
Sourcepub fn enter_filter_mode(&mut self)
pub fn enter_filter_mode(&mut self)
Enter filter mode
Sourcepub fn enter_search_mode(&mut self)
pub fn enter_search_mode(&mut self)
Enter search mode
Sourcepub fn exit_special_mode(&mut self)
pub fn exit_special_mode(&mut self)
Exit special modes back to normal
Handle navigation keys in normal mode
Sourcepub fn handle_filter_input(&mut self, key: KeyEvent) -> bool
pub fn handle_filter_input(&mut self, key: KeyEvent) -> bool
Handle filter input
Sourcepub fn handle_search_input(&mut self, key: KeyEvent) -> bool
pub fn handle_search_input(&mut self, key: KeyEvent) -> bool
Handle search input
Sourcepub fn get_selected_value(&self) -> Option<&DataValue>
pub fn get_selected_value(&self) -> Option<&DataValue>
Get the currently selected cell value
Sourcepub fn get_selected_column(&self) -> usize
pub fn get_selected_column(&self) -> usize
Get the currently selected column index
Sourcepub fn get_status_info(&self) -> String
pub fn get_status_info(&self) -> String
Get status information for display
Sourcepub fn create_table_widget(&self) -> Table<'_>
pub fn create_table_widget(&self) -> Table<'_>
Create a ratatui Table widget for rendering
Sourcepub fn create_input_widget(&self) -> Option<Paragraph<'_>>
pub fn create_input_widget(&self) -> Option<Paragraph<'_>>
Create input widget for filter/search modes
Trait Implementations§
Source§impl Clone for DataTableView
impl Clone for DataTableView
Source§fn clone(&self) -> DataTableView
fn clone(&self) -> DataTableView
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for DataTableView
impl RefUnwindSafe for DataTableView
impl Send for DataTableView
impl Sync for DataTableView
impl Unpin for DataTableView
impl UnwindSafe for DataTableView
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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