pub struct ColumnDef { /* private fields */ }
Expand description

A customisable struct for defining a column.

Implementations

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.

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.

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.

A function or expression that gets the value to be displayed from your data.

A function or an expression to format a value. Not used for CSV export or copy to clipboard; only for UI cell rendering.

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.

Set to true for this column to be hidden.

Same as ColumnDef::hide, except only applied when creating a new column. Not applied when updating column definitions.

Set to true to block making column visible/hidden via the UI (API will still work).

Lock a column to position to Left or Right to always have this column displayed in that position. True is treated as Left.

Set to true if you do not want this column to be movable via dragging.

Set to true if this column is editable.

Set to true to have the cell editor appear in a popup.

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.

Set to true to have cells under this column enter edit mode after single click.

Set whether the column is filterable, or use one of the provided filters.

Whether to display a floating filter for this column.

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.

Get the value for display in the header.

Tooltip for the column header.

CSS class to use for the header cell. Can be a string or, if using the header_class_array method, a vector of strings.

CSS class to use for the header cell. Can be a string or, if using the header_class_array method, a vector of strings.

Set to true to wrap long header names onto the next line.

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.

If true, a ‘select all’ checkbox will be put into the header.

If true, the header checkbox selection will only select filtered items.

Pin a column to one side: right or left. A value of True is converted to Left.

Same as ColumnDef::pinned, except only applied when creating a new column. Not applied when updating column definitions.

Set to true to block the user pinning the column, the column can only be pinned via definitions or API.

Set to true to have the grid calculate the height of a row based on contents of this column.

Set to true to have the text wrap inside the cell - typically used with ColumnDef::auto_height.

Set to true to flash a cell when it’s refreshed.

Set to true to prevent this column from flashing on changes. Only applicable if cell flashing is turned on for the grid.

Set to true to allow row dragging.

Set to true to allow dragging for native drag and drop.

Set wether the column is sortable.

Set the default sorting method.

The same as ColumnDef::sort, except only applied when creating a new column. Not applied when updating column definitions.

If sorting more than one column by default, specifies order in which the sorting should be applied.

Vector defining the order in which sorting occurs (if sorting is enabled). Expects a vector of any permutation of the SortMethod variants.

Set to true if you want the unsorted icon to be shown when no sort is applied to this column.

Set the span of the column.

Set the span of the row.

The field of the tooltip to apply to the cell.

Initial width in pixels for the cell.

The same as ColumnDef::width, except only applied when creating a new column. Not applied when updating column definitions.

Minimum width in pixels for the cell.

Maxmum width in pixels for the cell.

Used instead of width when the goal is to fill the remaining empty space of the grid.

The same as ColumnDef::flex, except only applied when creating a new column. Not applied when updating column definitions.

Set to true to allow this column to be resized.

Set to true if you want this column’s width to be fixed during ‘size to fit’ operations.

Set to true if you do not want this column to be auto-resizable by double clicking it’s edge.

Create a new column definition, specifying the field of the row object to get the cell’s data from. Deep references into a row object is supported via dot notation, i.e ‘address.firstLine’.

Trait Implementations

Returns the “default value” for a type. Read more
Convert the current type to a wasm_bindgen::JsValue;

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.