Expand description
TableView<T> — generic, virtualized, accessible tabular widget.
Built atop the ListModel<T> /
ListDataSource data layer in
teksilo-data and the teksilo-tokens TableStyle. Mirrors Qt’s
QTableView, SwiftUI’s Table, and JavaFX’s TableView.
The core skeleton: single body pane, row-virtualized with alternating
backgrounds, grid lines, Role::Table > Role::Row > Role::Cell
accessibility, multi-row selection, and an empty-state slot. Headers,
sort, filter, resize, reorder, pinning, cell selection, and editing are
also included. Row heights come in three modes: uniform (row_height,
the default fast path), exact per-row callback (row_height_fn), and
auto-measured (auto_row_height — rows grow to their tallest cell,
height-for-width). See docs/table-view.md “Row heights”.
use teksilo_data::ListModel;
use teksilo_widgets::table_view::{Column, ColumnWidth, TableView};
use teksilo_i18n::lit;
struct Person { name: String, age: u32 }
let model: ListModel<Person> = ListModel::new();
let _table = TableView::new(model)
.add_column(Column::new("name", ColumnWidth::Flex(1.0))
.label(lit!("Name"))
.cell(|p: &Person, _cx| Box::new(
teksilo_widgets::primitives::TextWidget::new(
teksilo_i18n::lit!(p.name.clone())
)
)))
.add_column(Column::new("age", ColumnWidth::Fixed(60.0))
.label(lit!("Age"))
.cell(|p: &Person, _cx| Box::new(
teksilo_widgets::primitives::TextWidget::new(
teksilo_i18n::lit!(p.age.to_string())
)
)))
.alternating_rows(true)
.row_height(32.0);Re-exports§
pub use self::column::Alignment;pub use self::column::CellContext;pub use self::column::Column;pub use self::column::ColumnContext;pub use self::column::ColumnResizePolicy;pub use self::column::ColumnWidth;pub use self::column::EditTriggers;pub use self::column::GridLines;pub use self::column::PinnedSide;pub use self::column::TabTraversal;pub use self::column::TruncationPolicy;pub use self::selection::CellSelectionModel;pub use self::selection::TableSelectionMode;
Modules§
- a11y
- Accessibility wrappers for
TableView/TreeTableView. - body
- Per-row container widget —
Role::Row, lays its cells horizontally using a shared column-width handle owned by the parent table. - body_
pane BodyPane<T>— the virtualized row pane underneath the header.- column
- Column descriptor + supporting enums for
TableViewandTreeTableView. - filter
- Per-column filter popover UI.
- header
- Sticky header strip + per-column header cells.
- imperative
- Imperative-API helpers shared by
TableViewandTreeTableView. - keyboard
- Shared keyboard handler for
TableViewandTreeTableView. - layout
- Column-width resolution + per-pane horizontal layout.
- row_
navigator - Trait abstracting per-row navigation for
TableViewandTreeTableView. - selection
- Selection types for
TableViewandTreeTableView.
Structs§
- Table
View - Generic, virtualized, accessible table with sortable / filterable / resizable columns.
Enums§
- Sort
Direction - Sort direction emitted by
TableView/TreeTableViewheaders and consumed by sort projections.