Skip to main content

DataTableColumnDef

Struct DataTableColumnDef 

Source
pub struct DataTableColumnDef {
Show 25 fields pub field: String, pub header_name: String, pub description: Option<String>, pub col_type: ColumnType, pub width: ColumnWidth, pub min_width: Option<f64>, pub max_width: Option<f64>, pub sortable: bool, pub filterable: bool, pub pinned: Option<PinSide>, pub align: CellAlign, pub hideable: bool, pub reorderable: bool, pub col_span: u32, pub row_span_merge: bool, pub resolve_value: Option<Callback<(DataRecord,), DataValue>>, pub format_display: Option<Callback<(DataValue,), String>>, pub cell_view: Option<Arc<dyn Fn(DataRecord) -> AnyView + Send + Sync>>, pub header_view: Option<Arc<dyn Fn() -> AnyView + Send + Sync>>, pub compare_values: Option<Callback<(DataValue, DataValue), Ordering>>, pub editable: bool, pub edit_options: Option<Vec<String>>, pub validate_value: Option<Callback<(DataValue,), Result<DataValue, String>>>, pub edit_view: Option<Arc<dyn Fn(EditCellProps) -> AnyView + Send + Sync>>, pub cell_class: Option<Callback<(DataRecord,), String>>,
}
Expand description

Column definition for crate::DataTable.

Fields§

§field: String

Binds to orbital_data::FieldDef::key in the dataset schema.

§header_name: String

Header label shown in the table.

§description: Option<String>

Optional column description (tooltip / a11y).

§col_type: ColumnType

Column type for typed sort/filter.

§width: ColumnWidth

Width mode (fixed, flex, or auto).

§min_width: Option<f64>

Minimum width in pixels.

§max_width: Option<f64>

Maximum width in pixels.

§sortable: bool

Whether this column participates in sorting.

§filterable: bool

Whether this column participates in quick-search / filtering.

§pinned: Option<PinSide>

Initial pin side from column definition.

§align: CellAlign

Horizontal alignment for cell content.

§hideable: bool

Whether the column can be hidden via picker/menu.

§reorderable: bool

Whether the column can be drag-reordered.

§col_span: u32

Body cell column span (number of logical columns merged).

§row_span_merge: bool

Merge consecutive equal values in this column into one cell.

§resolve_value: Option<Callback<(DataRecord,), DataValue>>

Optional value resolver (default: field lookup on record).

§format_display: Option<Callback<(DataValue,), String>>

Optional display formatter (default: DataValue::display_string).

§cell_view: Option<Arc<dyn Fn(DataRecord) -> AnyView + Send + Sync>>

Custom cell renderer.

§header_view: Option<Arc<dyn Fn() -> AnyView + Send + Sync>>

Custom header renderer.

§compare_values: Option<Callback<(DataValue, DataValue), Ordering>>

Custom sort comparator (default: typed compare by col_type).

§editable: bool

Whether this column supports inline editing.

§edit_options: Option<Vec<String>>

Select options for editable SingleSelect columns.

§validate_value: Option<Callback<(DataValue,), Result<DataValue, String>>>

Optional per-field validator run before row commit.

§edit_view: Option<Arc<dyn Fn(EditCellProps) -> AnyView + Send + Sync>>

Custom inline edit renderer (default: typed Input/Select/Checkbox/DatePicker).

§cell_class: Option<Callback<(DataRecord,), String>>

Optional per-cell CSS class callback.

Implementations§

Source§

impl DataTableColumnDef

Source

pub fn new(field: impl Into<String>, header_name: impl Into<String>) -> Self

Source

pub fn from_field_def(field: &FieldDef) -> Self

Build from a shared orbital_data::FieldDef.

Source

pub fn with_col_type(self, col_type: ColumnType) -> Self

Source

pub fn with_width(self, width: ColumnWidth) -> Self

Source

pub fn with_min_width(self, min_width: f64) -> Self

Source

pub fn with_max_width(self, max_width: f64) -> Self

Source

pub fn with_pinned(self, pinned: PinSide) -> Self

Source

pub fn with_align(self, align: CellAlign) -> Self

Source

pub fn with_hideable(self, hideable: bool) -> Self

Source

pub fn with_reorderable(self, reorderable: bool) -> Self

Source

pub fn with_col_span(self, col_span: u32) -> Self

Source

pub fn with_row_span_merge(self, enabled: bool) -> Self

Source

pub fn with_description(self, description: impl Into<String>) -> Self

Source

pub fn with_sortable(self, sortable: bool) -> Self

Source

pub fn with_filterable(self, filterable: bool) -> Self

Source

pub fn with_resolve_value(self, cb: Callback<(DataRecord,), DataValue>) -> Self

Source

pub fn with_format_display(self, cb: Callback<(DataValue,), String>) -> Self

Source

pub fn with_cell_view( self, view: Arc<dyn Fn(DataRecord) -> AnyView + Send + Sync>, ) -> Self

Source

pub fn with_header_view( self, view: Arc<dyn Fn() -> AnyView + Send + Sync>, ) -> Self

Source

pub fn with_compare_values( self, cb: Callback<(DataValue, DataValue), Ordering>, ) -> Self

Source

pub fn with_editable(self, editable: bool) -> Self

Source

pub fn with_edit_options(self, options: Vec<String>) -> Self

Source

pub fn with_validate_value( self, cb: Callback<(DataValue,), Result<DataValue, String>>, ) -> Self

Source

pub fn with_edit_view( self, view: Arc<dyn Fn(EditCellProps) -> AnyView + Send + Sync>, ) -> Self

Source

pub fn is_editable(&self) -> bool

Whether this column can enter inline edit mode.

Trait Implementations§

Source§

impl Clone for DataTableColumnDef

Source§

fn clone(&self) -> DataTableColumnDef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DataTableColumnDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DataTableColumnDef

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
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, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
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, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for El
where El: IntoElementMaybeSignalType<T, Marker>,

Source§

impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for El
where El: IntoElementsMaybeSignalType<T, Marker>,

Source§

impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
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<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
Source§

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

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + 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: Sized + ErasableGeneric<Repr = Self::Repr>,

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