Skip to main content

ColumnSchema

@spartanfx/react v1.2.2


@spartanfx/react / index / ColumnSchema

Interface: ColumnSchema

Describes a single column in the data grid schema.

Remarks

Defines field behavior, display properties, validation, formatting, and optional rendering.

Properties

Required

PropertyTypeDescription
fieldNamestringUnique identifier for the field (must match keys in data rows).
namestringHuman-readable column label.
type"boolean" | "option" | "text" | "date" | "dateTime" | "float" | "integer"Data type for the column (determines rendering and validation).

Options

PropertyTypeDescription
decimals?numberNumber of decimal places (only for float type).
defaultValue?anyDefault value to apply for new rows or blank inputs.
locked?booleanLocks the entire column from edits.
multiline?booleanIf true, allows multiline text input.
options?IDropdownOption<any>[]Options for dropdown fields (type: 'option').
readOnly?booleanMarks the column as read-only.
required?booleanMarks the field as required for validation.
width?string | numberOptional fixed width (e.g., "150px" or 150).

Events & callbacks

PropertyTypeDescription
applyStyle?(value, row) => CSSPropertiesFunction to compute custom style per cell based on its value and row.
onRenderControl?(props) => ReactElementOptional custom renderer for the input control.
onRenderValue?(value) => unknownOptional formatter function for display-only rendering.
validate?(value, row) => stringOptional validation function, returning an error message or undefined.