Skip to main content

ColumnDefBuilder

Struct ColumnDefBuilder 

Source
pub struct ColumnDefBuilder<T> { /* private fields */ }
Expand description

Builder for creating column definitions with a fluent API.

Allows step-by-step configuration of column properties before building the final ColumnDef instance.

Implementations§

Source§

impl<T> ColumnDefBuilder<T>

Source

pub fn new( id: impl Into<ColumnId>, header: impl Into<String>, ) -> ColumnDefBuilder<T>

Creates a new column builder with the given ID and header.

§Parameters
  • id: The column identifier.
  • header: The display header text.
§Returns
  • ColumnDefBuilder<T>: A new builder instance with default settings.
Source

pub fn accessor<V, F>(self, f: F) -> ColumnDefBuilder<T>
where V: DataTableDynValue + 'static, F: Fn(&T) -> V + Send + Sync + 'static,

Sets the accessor function for this column.

§Parameters
  • f: A function that extracts a value from row data.
§Returns
  • Self: The modified builder.
Source

pub fn footer(self, footer: impl Into<String>) -> ColumnDefBuilder<T>

Sets the footer text.

§Parameters
  • footer: The footer text to display.
§Returns
  • Self: The modified builder.
Source

pub fn sortable(self, sortable: bool) -> ColumnDefBuilder<T>

Sets whether the column is sortable.

§Parameters
  • sortable: Whether sorting is enabled.
§Returns
  • Self: The modified builder.
Source

pub fn filterable(self, filterable: bool) -> ColumnDefBuilder<T>

Sets whether the column is filterable.

§Parameters
  • filterable: Whether filtering is enabled.
§Returns
  • Self: The modified builder.
Source

pub fn resizable(self, resizable: bool) -> ColumnDefBuilder<T>

Sets whether the column is resizable.

§Parameters
  • resizable: Whether resizing is enabled.
§Returns
  • Self: The modified builder.
Source

pub fn visible(self, visible: bool) -> ColumnDefBuilder<T>

Sets whether the column is visible by default.

§Parameters
  • visible: Whether the column is visible.
§Returns
  • Self: The modified builder.
Source

pub fn min_width(self, width: f64) -> ColumnDefBuilder<T>

Sets the minimum column width.

§Parameters
  • width: The minimum width in pixels.
§Returns
  • Self: The modified builder.
Source

pub fn max_width(self, width: f64) -> ColumnDefBuilder<T>

Sets the maximum column width.

§Parameters
  • width: The maximum width in pixels.
§Returns
  • Self: The modified builder.
Source

pub fn default_width(self, width: f64) -> ColumnDefBuilder<T>

Sets the default column width.

§Parameters
  • width: The default width in pixels.
§Returns
  • Self: The modified builder.
Source

pub fn filter_placeholder( self, placeholder: impl Into<String>, ) -> ColumnDefBuilder<T>

Sets the filter placeholder text.

§Parameters
  • placeholder: The placeholder text for the filter input.
§Returns
  • Self: The modified builder.
Source

pub fn sorting_fn(self, f: SortingFn<T>) -> ColumnDefBuilder<T>

Sets a custom sorting function.

§Parameters
  • f: The custom sorting function.
§Returns
  • Self: The modified builder.
Source

pub fn filter_fn(self, f: FilterFn<T>) -> ColumnDefBuilder<T>

Sets a custom filter function.

§Parameters
  • f: The custom filter function.
§Returns
  • Self: The modified builder.
Source

pub fn aggregation_fn(self, f: AggregationFn<T>) -> ColumnDefBuilder<T>

Sets an aggregation function for grouped rows.

§Parameters
  • f: The aggregation function.
§Returns
  • Self: The modified builder.
Source

pub fn enable_multi_sort(self, enable: bool) -> ColumnDefBuilder<T>

Enables or disables multi-column sorting for this column.

§Parameters
  • enable: Whether multi-sort is enabled.
§Returns
  • Self: The modified builder.
Source

pub fn invert_sorting(self, invert: bool) -> ColumnDefBuilder<T>

Inverts the sort direction for this column.

§Parameters
  • invert: Whether to invert the sort direction.
§Returns
  • Self: The modified builder.
Source

pub fn sort_undefined_last(self, last: bool) -> ColumnDefBuilder<T>

Sets whether undefined values should be sorted last.

§Parameters
  • last: Whether undefined values sort last.
§Returns
  • Self: The modified builder.
Source

pub fn columns(self, columns: Vec<ColumnDef<T>>) -> ColumnDefBuilder<T>

Adds child columns to make this a group column.

§Parameters
  • columns: The child column definitions.
§Returns
  • Self: The modified builder.
Source

pub fn build(self) -> ColumnDef<T>

Builds the column definition.

§Returns
  • ColumnDef<T>: The constructed column definition.

Trait Implementations§

Source§

impl<T> Default for ColumnDefBuilder<T>

Provides a default column definition builder with empty ID and header.

Source§

fn default() -> ColumnDefBuilder<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoPropValue<Option<T>> for T

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<Token, Builder, How> AllPropsFor<Builder, How> for Token
where Builder: Buildable<Token>, <Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,

Source§

impl<T> HasAllProps<(), T> for T