ColumnDef API
ColumnDef
Constructor
Creates a column with no format and no editor override.
CellFormat
Methods
FormattedCell
CellAlign
CellValidator
A per-column validation callback. Call CellValidator::new to construct one:
See Validation for the full feature guide.
ValidationRule
Declarative rules attached to ColumnDef::rules, checked in order,
first failure wins, before the legacy validator.
Builder sugar on ColumnDef
ColumnDef::validate_value
Runs rules in order, then validator if all rules passed. Returns the
first failure's message, if any.
See Validation for InvalidEditMode and live
per-keystroke feedback.
RowPredicate<T>
Generic per-row callback wrapper backing EditablePredicate, CellDecorator,
and CellButtonsVisible below — each is a type alias over RowPredicate<T>
for a different T, not a separate implementation. EditablePredicate and
CellButtonsVisible are both RowPredicate<bool>, so they're the literal
same type (and print identical Debug output); CellDecorator is
RowPredicate<Option<CellDecoration>>.
EditablePredicate
A dynamic per-cell editability override, attached to ColumnDef.editable_predicate.
Receives the row index and the full GridModel, so it
can implement cross-column logic (e.g. lock a cell when another column's
value is "locked") — not just this column's own value.
See RowPredicate<T> above for new/evaluate.
Builder sugar on ColumnDef
ColumnDef::is_cell_editable
Resolves whether row is editable in this column: false if the static
editable flag is false (the predicate is not even called); otherwise
the predicate's result, or true if no predicate is set.
See Per-cell editability for the
full feature guide, including the not-allowed cursor and themed
locked-cell styling.
CellDecoration
A persistent, at-rest visual annotation for a single cell — a border color and/or background tint that stays visible whenever the cell is on screen, not just while it's being edited. Purely cosmetic: unlike validation, it never blocks a value from being committed, only changes how the cell is painted.
border_color/background_tint are RGBA ([r, g, b, a]), supplied
directly by your closure — not read from the theme.
Only the border's stroke width is themed
(--rs-grid-decoration-border-width, default 1.5px), since it's uniform
across every decorated cell regardless of which color you pick.
message is reserved for a future native hover tooltip — it is not
rendered anywhere yet.
CellDecoration is #[non_exhaustive], so build one from
CellDecoration::default() chained with the builders below rather than
struct-literal syntax:
CellDecorator
A dynamic per-cell decoration callback, attached to ColumnDef.decorator.
Same RowPredicate<T> family as EditablePredicate
(different T): receives the row index and the full
GridModel, so it can implement cross-column logic —
e.g. flag a cell when a paired column is inconsistent.
See RowPredicate<T> above for new/evaluate.
Builder sugar on ColumnDef
ColumnDef::cell_decoration
Resolves this cell's decoration, if any. Unlike is_cell_editable, there
is no static gate — a decoration is purely cosmetic and not affected by
ColumnDef::editable/GridModel::editable.
See Per-cell decoration for the full feature guide.
CellButtonsVisible
A dynamic per-row visibility override for ColumnDef.cell_buttons, attached
to ColumnDef.cell_buttons_visible. Same RowPredicate<T>
family as EditablePredicate/CellDecorator — in fact the exact same
concrete type as EditablePredicate (RowPredicate<bool>): receives the
row index and the full GridModel, so it can implement
cross-column logic — e.g. hide a button when a paired URL column is empty.
See RowPredicate<T> above for new/evaluate.
Builder sugar on ColumnDef
ColumnDef::are_cell_buttons_visible
Resolves whether cell_buttons should be drawn for row. Like
cell_decoration, there is no static gate — true whenever no predicate is
set (today's behaviour).
See Cell Buttons for the full feature guide.

