pub struct ColumnDef<T> {
pub meta: ColumnMeta,
pub accessor: Option<DataTableDynAccessor<T>>,
pub sorting_fn: Option<SortingFn<T>>,
pub filter_fn: Option<FilterFn<T>>,
pub aggregation_fn: Option<AggregationFn<T>>,
pub columns: Vec<ColumnDef<T>>,
pub enable_multi_sort: bool,
pub invert_sorting: bool,
pub sort_undefined_last: bool,
}Expand description
Definition of a table column.
ColumnDef is generic over the row data type T and provides
all configuration needed to display and interact with a column.
Fields§
§meta: ColumnMetaColumn metadata (ID, header, footer, etc.).
accessor: Option<DataTableDynAccessor<T>>Accessor function to get the cell value from row data.
sorting_fn: Option<SortingFn<T>>Custom sorting function.
filter_fn: Option<FilterFn<T>>Custom filter function.
aggregation_fn: Option<AggregationFn<T>>Aggregation function for grouped rows.
columns: Vec<ColumnDef<T>>Child columns for grouped columns.
enable_multi_sort: boolEnable multi-sorting for this column.
invert_sorting: boolInvert the sort direction.
sort_undefined_last: boolSort undefined values to the end.
Implementations§
Source§impl<T> ColumnDef<T>
impl<T> ColumnDef<T>
Sourcepub fn group(
id: impl Into<ColumnId>,
header: impl Into<String>,
columns: Vec<ColumnDef<T>>,
) -> Self
pub fn group( id: impl Into<ColumnId>, header: impl Into<String>, columns: Vec<ColumnDef<T>>, ) -> Self
Sourcepub fn is_sortable(&self) -> bool
pub fn is_sortable(&self) -> bool
Sourcepub fn is_filterable(&self) -> bool
pub fn is_filterable(&self) -> bool
Returns whether this column is filterable.
§Returns
bool: Whether filtering is enabled for this column.
Sourcepub fn is_group(&self) -> bool
pub fn is_group(&self) -> bool
Returns whether this column is a group column.
§Returns
bool: Whether this is a group column containing sub-columns.
Sourcepub fn children(&self) -> &[ColumnDef<T>]
pub fn children(&self) -> &[ColumnDef<T>]
Returns the child columns for group columns.
§Returns
&[ColumnDef<T>]: A slice of child column definitions.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ColumnDef<T>
impl<T> !RefUnwindSafe for ColumnDef<T>
impl<T> Send for ColumnDef<T>
impl<T> Sync for ColumnDef<T>
impl<T> Unpin for ColumnDef<T>
impl<T> UnsafeUnpin for ColumnDef<T>
impl<T> !UnwindSafe for ColumnDef<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more