pub struct GridColumn { /* private fields */ }Expand description
A data grid column: title, width, alignment, formatting and capabilities.
Implementations§
Source§impl GridColumn
impl GridColumn
Sourcepub fn text(title: impl Into<String>) -> GridColumn
pub fn text(title: impl Into<String>) -> GridColumn
A text column.
Sourcepub fn number(title: impl Into<String>) -> GridColumn
pub fn number(title: impl Into<String>) -> GridColumn
A right-aligned number column with thousands separators.
Sourcepub fn currency(
title: impl Into<String>,
prefix: &str,
decimals: usize,
) -> GridColumn
pub fn currency( title: impl Into<String>, prefix: &str, decimals: usize, ) -> GridColumn
A number column formatted as money: currency("MRR", "R$ ", 2).
Sourcepub fn boolean(title: impl Into<String>) -> GridColumn
pub fn boolean(title: impl Into<String>) -> GridColumn
A yes/no column.
Sourcepub fn date(title: impl Into<String>) -> GridColumn
pub fn date(title: impl Into<String>) -> GridColumn
A date column, written 2026-11-02 unless format says otherwise.
Sourcepub fn field(self, field: impl Into<String>) -> GridColumn
pub fn field(self, field: impl Into<String>) -> GridColumn
The name of the field this column shows, which stays when the title is translated.
Sourcepub fn field_name(&self) -> Option<&str>
pub fn field_name(&self) -> Option<&str>
The name given by field.
Sourcepub fn width(self, width: f32) -> GridColumn
pub fn width(self, width: f32) -> GridColumn
Sets the width in logical pixels, never below the column’s minimum.
Sourcepub fn resizable(self, resizable: bool) -> GridColumn
pub fn resizable(self, resizable: bool) -> GridColumn
Whether people can change the width, by the handle or the column’s menu (they can
by default). With false, it keeps the width it has been given, or what a
Self::fill column gets from the room left.
Sourcepub fn align(self, align: CellAlign) -> GridColumn
pub fn align(self, align: CellAlign) -> GridColumn
Sets the cell alignment.
Sourcepub fn number_format(self, format: NumberFormat) -> GridColumn
pub fn number_format(self, format: NumberFormat) -> GridColumn
Decimal places and separators for number columns.
Sourcepub fn summary(self, summary: Summary) -> GridColumn
pub fn summary(self, summary: Summary) -> GridColumn
Shows this aggregate in group rows and the footer.
Sourcepub fn sortable(self, sortable: bool) -> GridColumn
pub fn sortable(self, sortable: bool) -> GridColumn
Whether clicking the header sorts by this column (default true).
Sourcepub fn filterable(self, filterable: bool) -> GridColumn
pub fn filterable(self, filterable: bool) -> GridColumn
Whether the filter row has a field for this column (default true).
Sourcepub fn groupable(self, groupable: bool) -> GridColumn
pub fn groupable(self, groupable: bool) -> GridColumn
Whether rows can be grouped by this column (default true).
Sourcepub fn editable(self) -> GridColumn
pub fn editable(self) -> GridColumn
Cells can be edited (double-click, Enter or F2).
Sourcepub fn summary_formula(self, formula: impl Into<String>) -> GridColumn
pub fn summary_formula(self, formula: impl Into<String>) -> GridColumn
Works out the summary of the group rows and the footer with a formula over their
rows, in place of summary, such as
Sum([Seats]) / Count(). Columns go by their titles.
Sourcepub fn pinned(self, pinned: bool) -> GridColumn
pub fn pinned(self, pinned: bool) -> GridColumn
Stays in place at the left while the others scroll sideways.
Sourcepub fn fill(self) -> GridColumn
pub fn fill(self) -> GridColumn
Takes the width the columns leave over, so a wide window has no empty stretch
at the end of the rows. Its Self::width is what it never goes below.
Starts hidden; users can show it from the column chooser.
Sourcepub fn format(self, f: impl Fn(&Value) -> String + 'static) -> GridColumn
pub fn format(self, f: impl Fn(&Value) -> String + 'static) -> GridColumn
Custom text for each value (also used by filtering, search and export).
Sourcepub fn template(
self,
f: impl Fn(&Value) -> Box<dyn View> + 'static,
) -> GridColumn
pub fn template( self, f: impl Fn(&Value) -> Box<dyn View> + 'static, ) -> GridColumn
Custom view for each cell (a badge, an avatar…).
Sourcepub fn display_summary(&self, summary: Summary, value: f64) -> String
pub fn display_summary(&self, summary: Summary, value: f64) -> String
Formats an aggregate of this column.
Trait Implementations§
Source§impl Clone for GridColumn
impl Clone for GridColumn
Source§fn clone(&self) -> GridColumn
fn clone(&self) -> GridColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more