Skip to main content

IDataGridProps

@spartanfx/react v1.2.2


@spartanfx/react / index / IDataGridProps

Interface: IDataGridProps

Props for the top-level ExcelGrid component.

Properties

Required

PropertyTypeDefaultDescription
getRowId(row) => string | number-Function to retrieve a unique ID for each row.
onChange(changes) => void-Callback triggered with changes to the grid data.
rawDataRecord<string, unknown>[]-The raw tabular data to display.
schemaColumnSchema[]-Schema defining columns, types, and behavior.

Options

PropertyTypeDefaultDescription
defaultSort?object-Optional initial sort configuration.
defaultSort.columnstring-Field name to sort by.
defaultSort.direction"desc" | "asc"-Sort direction.
editable?boolean-Enables or disables cell editing.
enableNewRow?booleantrueEnables or disables the trailing blank row for new data entry.
enableRowDeletion?boolean-Enables row deletion via UI or keyboard.
enableRowSelection?booleantrueEnables or disables row selection checkboxes.
layout?DataGridLayoutDataGridLayout.fluidColumn 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

PropertyTypeDefaultDescription
onSortChange?(column, direction) => void-Callback triggered when the user changes sort order.

Appearance & theming

PropertyTypeDefaultDescription
appearance?AppearanceModeAppearanceMode.lightVisual appearance mode.