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 number(title: impl Into<String>) -> Self
pub fn number(title: impl Into<String>) -> Self
A right-aligned number column with thousands separators.
Sourcepub fn currency(title: impl Into<String>, prefix: &str, decimals: usize) -> Self
pub fn currency(title: impl Into<String>, prefix: &str, decimals: usize) -> Self
A number column formatted as money: currency("MRR", "R$ ", 2).
Sourcepub fn date(title: impl Into<String>) -> Self
pub fn date(title: impl Into<String>) -> Self
A date column, written 2026-11-02 unless format says otherwise.
Sourcepub fn field(self, field: impl Into<String>) -> Self
pub fn field(self, field: impl Into<String>) -> Self
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) -> Self
pub fn width(self, width: f32) -> Self
Sets the width in logical pixels, never below the column’s minimum.
Sourcepub fn resizable(self, resizable: bool) -> Self
pub fn resizable(self, resizable: bool) -> Self
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 number_format(self, format: NumberFormat) -> Self
pub fn number_format(self, format: NumberFormat) -> Self
Decimal places and separators for number columns.
Sourcepub fn summary(self, summary: Summary) -> Self
pub fn summary(self, summary: Summary) -> Self
Shows this aggregate in group rows and the footer.
Sourcepub fn sortable(self, sortable: bool) -> Self
pub fn sortable(self, sortable: bool) -> Self
Whether clicking the header sorts by this column (default true).
Sourcepub fn filterable(self, filterable: bool) -> Self
pub fn filterable(self, filterable: bool) -> Self
Whether the filter row has a field for this column (default true).
Sourcepub fn groupable(self, groupable: bool) -> Self
pub fn groupable(self, groupable: bool) -> Self
Whether rows can be grouped by this column (default true).
Sourcepub fn summary_formula(self, formula: impl Into<String>) -> Self
pub fn summary_formula(self, formula: impl Into<String>) -> Self
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) -> Self
pub fn pinned(self, pinned: bool) -> Self
Stays in place at the left while the others scroll sideways.
Sourcepub fn fill(self) -> Self
pub fn fill(self) -> Self
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) -> Self
pub fn format(self, f: impl Fn(&Value) -> String + 'static) -> Self
Custom text for each value (also used by filtering, search and export).
Sourcepub fn template(self, f: impl Fn(&Value) -> AnyView + 'static) -> Self
pub fn template(self, f: impl Fn(&Value) -> AnyView + 'static) -> Self
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