Struct ag_grid_rs::column::ColumnDef
source · [−]pub struct ColumnDef { /* private fields */ }
Expand description
A customisable struct for defining a column.
Implementations
sourceimpl ColumnDef
impl ColumnDef
sourcepub fn col_id(self, value: impl AsRef<str>) -> Self
pub fn col_id(self, value: impl AsRef<str>) -> Self
The unique ID to give the column. This is optional. If missing, the ID will default to the field. If both field and colId are missing, a unique ID will be generated. This ID is used to identify the column in the API for sorting, filtering etc.
sourcepub fn type_(self, value: impl AsRef<str>) -> Self
pub fn type_(self, value: impl AsRef<str>) -> Self
A comma separated string or if using the ColumnDef::type_array
method, a vector of strings containing ColumnType keys which can be
used as a template for a column. This helps to reduce duplication of
properties when you have a lot of common column properties.
sourcepub fn type_array(self, value: Vec<impl AsRef<str>>) -> Self
pub fn type_array(self, value: Vec<impl AsRef<str>>) -> Self
A comma separated string or if using the ColumnDef::type_array
method, a vector of strings containing ColumnType keys which can be
used as a template for a column. This helps to reduce duplication of
properties when you have a lot of common column properties.
sourcepub fn value_getter(self, value: impl AsRef<str>) -> Self
pub fn value_getter(self, value: impl AsRef<str>) -> Self
A function or expression that gets the value to be displayed from your data.
sourcepub fn value_formatter(self, value: impl AsRef<str>) -> Self
pub fn value_formatter(self, value: impl AsRef<str>) -> Self
A function or an expression to format a value. Not used for CSV export or copy to clipboard; only for UI cell rendering.
sourcepub fn show_disabled_checkboxes(self, value: bool) -> Self
pub fn show_disabled_checkboxes(self, value: bool) -> Self
Provide a reference data map to be used to map column values to their
respective value from the map.
Set to true
to display a disabled checkbox when row is not selectable
and checkboxes are enabled.
sourcepub fn initial_hide(self, value: bool) -> Self
pub fn initial_hide(self, value: bool) -> Self
Same as ColumnDef::hide
, except only applied when creating a new
column. Not applied when updating column definitions.
sourcepub fn lock_visible(self, value: bool) -> Self
pub fn lock_visible(self, value: bool) -> Self
Set to true
to block making column visible/hidden via the UI (API will
still work).
sourcepub fn lock_position(self, value: LockPosition) -> Self
pub fn lock_position(self, value: LockPosition) -> Self
Lock a column to position to Left
or Right
to always have this
column displayed in that position. True
is treated as Left
.
sourcepub fn suppress_movable(self, value: bool) -> Self
pub fn suppress_movable(self, value: bool) -> Self
Set to true
if you do not want this column to be movable via dragging.
sourcepub fn cell_editor_popup(self, value: bool) -> Self
pub fn cell_editor_popup(self, value: bool) -> Self
Set to true
to have the cell editor appear in a popup.
sourcepub fn cell_editor_popup_position(self, value: PopupPosition) -> Self
pub fn cell_editor_popup_position(self, value: PopupPosition) -> Self
Set the position for the popup cell editor. Possible values are Over
,
whereby the popup will be positioned over the cell, or Under
, whereby
the popup will be positioned below the cell leaving the cell value
visible.
sourcepub fn single_click_edit(self, value: bool) -> Self
pub fn single_click_edit(self, value: bool) -> Self
Set to true
to have cells under this column enter edit mode after
single click.
sourcepub fn filter(self, value: Filter) -> Self
pub fn filter(self, value: Filter) -> Self
Set whether the column is filterable, or use one of the provided filters.
sourcepub fn floating_filter(self, value: bool) -> Self
pub fn floating_filter(self, value: bool) -> Self
Whether to display a floating filter for this column.
sourcepub fn header_name(self, value: impl AsRef<str>) -> Self
pub fn header_name(self, value: impl AsRef<str>) -> Self
The name to render in the column header. If not specified and field is specified, the field name will be used as the header name.
sourcepub fn header_value_getter(
self,
value: impl FnMut(HeaderValueGetterParams) -> String + 'static
) -> Self
pub fn header_value_getter(
self,
value: impl FnMut(HeaderValueGetterParams) -> String + 'static
) -> Self
Get the value for display in the header.
sourcepub fn header_tooltip(self, value: impl AsRef<str>) -> Self
pub fn header_tooltip(self, value: impl AsRef<str>) -> Self
Tooltip for the column header.
sourcepub fn header_class(self, value: impl AsRef<str>) -> Self
pub fn header_class(self, value: impl AsRef<str>) -> Self
CSS class to use for the header cell. Can be a string or, if using the
header_class_array
method, a vector of strings.
sourcepub fn header_class_array(self, value: Vec<impl AsRef<str>>) -> Self
pub fn header_class_array(self, value: Vec<impl AsRef<str>>) -> Self
CSS class to use for the header cell. Can be a string or, if using the
header_class_array
method, a vector of strings.
sourcepub fn wrap_header_text(self, value: bool) -> Self
pub fn wrap_header_text(self, value: bool) -> Self
Set to true
to wrap long header names onto the next line.
sourcepub fn auto_header_height(self, value: bool) -> Self
pub fn auto_header_height(self, value: bool) -> Self
Set to true
to enable the header row to automatically adjust its
height to accommodate the size of the header cell.
Select which menu tabs are present, and in what order they are shown.
Set to true
to disable showing the menu for this column header.
sourcepub fn header_checkbox_selection(self, value: bool) -> Self
pub fn header_checkbox_selection(self, value: bool) -> Self
If true
, a ‘select all’ checkbox will be put into the header.
sourcepub fn header_checkbox_selection_filtered_only(self, value: bool) -> Self
pub fn header_checkbox_selection_filtered_only(self, value: bool) -> Self
If true
, the header checkbox selection will only select filtered
items.
sourcepub fn pinned(self, value: PinnedPosition) -> Self
pub fn pinned(self, value: PinnedPosition) -> Self
Pin a column to one side: right or left. A value of True
is converted
to Left
.
sourcepub fn initial_pinned(self, value: PinnedPosition) -> Self
pub fn initial_pinned(self, value: PinnedPosition) -> Self
Same as ColumnDef::pinned
, except only applied when creating a new
column. Not applied when updating column definitions.
sourcepub fn lock_pinned(self, value: bool) -> Self
pub fn lock_pinned(self, value: bool) -> Self
Set to true
to block the user pinning the column, the column can only
be pinned via definitions or API.
sourcepub fn auto_height(self, value: bool) -> Self
pub fn auto_height(self, value: bool) -> Self
Set to true
to have the grid calculate the height of a row based on
contents of this column.
sourcepub fn wrap_text(self, value: bool) -> Self
pub fn wrap_text(self, value: bool) -> Self
Set to true
to have the text wrap inside the cell - typically used
with ColumnDef::auto_height
.
sourcepub fn enable_cell_change_flash(self, value: bool) -> Self
pub fn enable_cell_change_flash(self, value: bool) -> Self
Set to true
to flash a cell when it’s refreshed.
sourcepub fn suppress_cell_flash(self, value: bool) -> Self
pub fn suppress_cell_flash(self, value: bool) -> Self
Set to true
to prevent this column from flashing on changes. Only
applicable if cell flashing is turned on for the grid.
sourcepub fn dnd_source(self, value: bool) -> Self
pub fn dnd_source(self, value: bool) -> Self
Set to true
to allow dragging for native drag and drop.
sourcepub fn sort(self, value: SortMethod) -> Self
pub fn sort(self, value: SortMethod) -> Self
Set the default sorting method.
sourcepub fn initial_sort(self, value: SortMethod) -> Self
pub fn initial_sort(self, value: SortMethod) -> Self
The same as ColumnDef::sort
, except only applied when creating a new
column. Not applied when updating column definitions.
sourcepub fn sort_index(self, value: Option<u32>) -> Self
pub fn sort_index(self, value: Option<u32>) -> Self
If sorting more than one column by default, specifies order in which the sorting should be applied.
sourcepub fn sorting_order(self, value: Vec<SortMethod>) -> Self
pub fn sorting_order(self, value: Vec<SortMethod>) -> Self
Vector defining the order in which sorting occurs (if sorting is
enabled). Expects a vector of any permutation of the SortMethod
variants.
sourcepub fn unsort_icon(self, value: bool) -> Self
pub fn unsort_icon(self, value: bool) -> Self
Set to true
if you want the unsorted icon to be shown when no sort is
applied to this column.
sourcepub fn tooltip_field(self, value: impl AsRef<str>) -> Self
pub fn tooltip_field(self, value: impl AsRef<str>) -> Self
The field of the tooltip to apply to the cell.
sourcepub fn initial_width(self, value: u32) -> Self
pub fn initial_width(self, value: u32) -> Self
The same as ColumnDef::width
, except only applied when creating a
new column. Not applied when updating column definitions.
sourcepub fn flex(self, value: u32) -> Self
pub fn flex(self, value: u32) -> Self
Used instead of width when the goal is to fill the remaining empty space of the grid.
sourcepub fn initial_flex(self, value: u32) -> Self
pub fn initial_flex(self, value: u32) -> Self
The same as ColumnDef::flex
, except only applied when creating a new
column. Not applied when updating column definitions.
sourcepub fn suppress_size_to_fit(self, value: bool) -> Self
pub fn suppress_size_to_fit(self, value: bool) -> Self
Set to true
if you want this column’s width to be fixed during ‘size
to fit’ operations.
sourcepub fn suppress_auto_size(self, value: bool) -> Self
pub fn suppress_auto_size(self, value: bool) -> Self
Set to true
if you do not want this column to be auto-resizable by
double clicking it’s edge.