@spartanfx/react v1.2.2
@spartanfx/react / index / ColumnSchema
Interface: ColumnSchema
Describes a single column in the data grid schema.
Defines field behavior, display properties, validation, formatting, and optional rendering.
Properties
Required
| Property | Type | Description |
|---|
fieldName | string | Unique identifier for the field (must match keys in data rows). |
name | string | Human-readable column label. |
type | "boolean" | "option" | "text" | "date" | "dateTime" | "float" | "integer" | Data type for the column (determines rendering and validation). |
Options
| Property | Type | Description |
|---|
decimals? | number | Number of decimal places (only for float type). |
defaultValue? | any | Default value to apply for new rows or blank inputs. |
locked? | boolean | Locks the entire column from edits. |
multiline? | boolean | If true, allows multiline text input. |
options? | IDropdownOption<any>[] | Options for dropdown fields (type: 'option'). |
readOnly? | boolean | Marks the column as read-only. |
required? | boolean | Marks the field as required for validation. |
width? | string | number | Optional fixed width (e.g., "150px" or 150). |
Events & callbacks
| Property | Type | Description |
|---|
applyStyle? | (value, row) => CSSProperties | Function to compute custom style per cell based on its value and row. |
onRenderControl? | (props) => ReactElement | Optional custom renderer for the input control. |
onRenderValue? | (value) => unknown | Optional formatter function for display-only rendering. |
validate? | (value, row) => string | Optional validation function, returning an error message or undefined. |