Skip to main content

Module data_table

Module data_table 

Expand description

DataTable primitive — sortable, resizable, virtualized tabular view. Sort is non-destructive: rows stay in insertion order and an index view carries the display order, so DataTable::sort_by_with re-applies the remembered comparator whenever local rows change, while DataTable::from_model delegates order and paging to TableModel. Its sparse viewport keeps memory proportional to what is shown.

Structs§

CellState
What a cell’s row is doing when the cell paints.
ColumnDef
DataTable
A table of Rows: the DataTableCore that does the work (everything a table does, compiled once into the toolkit for rows of any type) and the row type its callers read and write.
DataTableCore
DataTableFace
An immediate-mode table for a painted host (a track list): the DataTable’s header, columns, row heights, zebra and lift, painted per frame. paint takes the table’s content rect; the lift and stripe bleed past it by crate::chrome::row_bleed as the retained table’s do. The host hit-tests with Self::row_at and scrolls by passing the rows it shows.
FaceColumn
TableSort
Which column a table is sorted by and in which direction. Hand the table a crate::LocalState of it (DataTable::with_sort_state) and the order a person chose survives the view being built again.

Enums§

CellAlign
Where a column’s header, text, badges and controls sit across its width. A column follows its TextKind unless it says otherwise: numbers at the trailing edge, everything else at the leading edge.
ColumnWidth
Auto is sized to content at build time (treated as Flex(1.0) until the layout pass can measure it).

Traits§

TableModel
Unopinionated backing model for very large or asynchronously populated tables. Implementations need not keep all rows resident: DataTable queries only the visible range plus overscan.

Functions§

text_band
A structural band that follows the type: floor is the widget’s 1× default, which content + padding never undercuts at the default text scale, so 1× layouts are unchanged and only larger type grows the band.
type_line_height
One line of role as the renderer will lay it out: the role’s resolved size times its leading, so a band sized from this at layout time agrees with the line the widget measures and centres at paint time.

Type Aliases§

AnyRow
A row whose type the table no longer names: what DataTableCore holds and its columns read. DataTable converts at its edges.
CellAccessibleValue
CellBadge
A cell’s badge: a short label and the tone it carries (a status, a level). An empty label paints nothing.
CellChecked
Whether a checkbox column’s box is ticked for a row.
CellRender
A cell painter: the cell rect is in the table’s coordinates, and the transform is the one the table paints with (an outer scroll’s offset included).
CellText
A cell’s text, or None for an absent value (a SQL NULL, an unset field), which the table paints dimmed as the column’s absent label.
CellTextRender
Register one per column via ColumnDef::with_text_render; columns without one render nothing (header + chrome still draw). Gets the table’s transform (the cell rect is in the table’s coordinates) and the row’s CellState, so a cell can change with its row: its ink when selected, a glyph that shows under the pointer.
CellWidgetBuilder
Builds a real retained widget for one visible cell. The widget is keyed by the row’s stable identity and the column key, so it survives sorting and scrolling while that cell remains in the mounted window.
ColumnCompare
How two rows order under a column, for the table’s own sorting.
SortCmp
TableModelChange
One model notification batch consumed after the backing data has changed: a list’s change ([crate::widget::ListModelChange]) over the table’s row keys. Structural variants preserve mounted controls by stable row key; RowsChanged rebuilds controls only for the named rows.