IDataGridProps
@spartanfx/react / index / IDataGridProps
Interface: IDataGridProps
Props for the top-level ExcelGrid component.
Properties
Required
| Property | Type | Default | Description |
|---|---|---|---|
getRowId | (row) => string | number | - | Function to retrieve a unique ID for each row. |
onChange | (changes) => void | - | Callback triggered with changes to the grid data. |
rawData | Record<string, unknown>[] | - | The raw tabular data to display. |
schema | ColumnSchema[] | - | Schema defining columns, types, and behavior. |
Options
| Property | Type | Default | Description |
|---|---|---|---|
defaultSort? | object | - | Optional initial sort configuration. |
defaultSort.column | string | - | Field name to sort by. |
defaultSort.direction | "desc" | "asc" | - | Sort direction. |
editable? | boolean | - | Enables or disables cell editing. |
enableNewRow? | boolean | true | Enables or disables the trailing blank row for new data entry. |
enableRowDeletion? | boolean | - | Enables row deletion via UI or keyboard. |
enableRowSelection? | boolean | true | Enables or disables row selection checkboxes. |
layout? | DataGridLayout | DataGridLayout.fluid | Column layout mode. |
lockedCells? | Map<string, boolean> | - | Map of locked cell keys (formatted as "rowIdx-colIdx"). |
lockedRows? | Set<number> | - | Set of row indices that are locked (cannot be edited or deleted). |
sortable? | boolean | - | Enables column sorting via header clicks. |
stickyColumnsCount? | number | - | Number of columns to freeze on the left. |
Events & callbacks
| Property | Type | Default | Description |
|---|---|---|---|
onSortChange? | (column, direction) => void | - | Callback triggered when the user changes sort order. |
Appearance & theming
| Property | Type | Default | Description |
|---|---|---|---|
appearance? | AppearanceMode | AppearanceMode.light | Visual appearance mode. |