pub struct Column<'a> {
pub name: &'a str,
pub width: Width,
pub priority: Priority,
pub sortable: bool,
pub sorted: Option<Sort>,
}Expand description
One column of a table.
Described once. The grid track, the cell order and the drop behaviour are all derived from this, rather than being three hand-written encodings that must agree and are never checked against each other.
Fields§
§name: &'a strThe heading, and the name the cell is addressed by.
width: WidthHow much room it asks for.
priority: PriorityWhat it is worth when room runs out.
sortable: boolWhether the user can reorder the table by this column.
ce620871. What reordering calls is not here — that is an address, and
this crate names none — so a host pairs this with the route the way it
pairs a row’s parts with the row’s activation. This says the affordance
exists, which is what a renderer needs to draw a header a user can press
rather than a heading they cannot.
sorted: Option<Sort>Which way the table is ordered by this column, if it is.
None on every column but the one in force. A renderer draws the caret
from this and a webview sets aria-sort, which is why it is per column
rather than a single fact on the table: the host idiom is a property of
the header cell.
Independent of sortable rather than implied by it,
because both combinations mean something. A column sorted and not
sortable is a list ordered by a key the user cannot change, which is a
real thing to describe and a caret worth drawing.