Skip to content

Grid Configuration

The GridConfig interface controls the appearance and behavior of the grid.

Core Properties

PropertyTypeDefaultDescription
rowHeightnumber30Height of each row in pixels.
columnWidthnumber100Default width of columns in pixels.
headerHeightnumber30Height of the header row.
showRowNumbersbooleanfalseWhether to show the fixed index column.
rowNumbersWidthnumber40Width of the row number column.

Feature Flags

PropertyTypeDefaultDescription
allowResizingbooleantrueAllow users to resize columns by dragging separators.
allowFilteringbooleanfalseEnable/Disable filtering UI (if available).
persistenceKeystringundefinedIf set, grid state (column width/order) is saved to localStorage.
maskNumericValuesbooleanfalseIf true, values that exceed cell width are shown as ####.
maskTextValuesbooleanfalseIf true, text that exceeds cell width is replaced by textMaskString.
textMaskStringstring"..."The string used to mask truncated text (e.g. ..., ***).

Event Callbacks

PropertyTypeDescription
onSelectionChange(info: SelectionInfo) => voidFired when selection changes.
onSort(col, order) => voidFired when a sortable header is clicked.
onHeaderContextMenu(col, e) => voidRight-click on column header. Suppresses built-in menu.
onRowNumberContextMenu(row, e) => voidRight-click on row number. Suppresses built-in menu.
onContextMenu(row, col, e) => voidRight-click on data cell. Call e.preventDefault() to suppress built-in menu.
getContextMenuItems(defaults, context?) => itemsCustomize built-in menu items per zone. See Events API.
onShortcut(action, e) => voidFired for custom keyboard shortcuts.
onCellEdit(event: CellEditEvent) => voidFired after a cell is edited (with undo tracking).
onFilterChange(filters: ColumnFilter[]) => voidFired when filters change.
onSortChange(sorts: SortState[]) => voidFired when multi-column sort changes.
onQuickFilterChange(text: string) => voidFired when quick filter text changes.

See the Events API for full details and examples.

Keyboard Shortcuts

PropertyTypeDescription
keyboardShortcutsPartial<KeyboardShortcuts>Override or disable built-in shortcuts, or define custom ones.

See the Keyboard Shortcuts guide for full details.

Cell Editing & Validation

PropertyTypeDefaultDescription
validatorsRecord<number, CellValidator>undefinedPer-column validation functions. Return true or error string.
undoHistorySizenumber100Max undo/redo stack size.
showFormulaBarbooleanfalseShow formula bar displaying active cell reference and value.
formattingRulesCellFormattingRule[]undefinedConditional formatting rules.

Filtering & Sorting

PropertyTypeDefaultDescription
filtersColumnFilter[]undefinedActive column filters.
sortStateSortState[]undefinedMulti-column sort state.
showQuickFilterbooleanfalseShow global quick filter bar.
quickFilterTextstringundefinedCurrent quick filter text.

Grouping & Aggregation

PropertyTypeDefaultDescription
groupByGroupConfigundefinedGroup rows by a column.
footerRowFooterRowundefinedFooter row with aggregations.
pinnedRowsPinnedRow[]undefinedPinned rows (top/bottom).

Styling

PropertyTypeDescription
backgroundColorstringCanvas background color.
gridLineColorstringColor of grid lines.
textColorstringDefault text color for cells.
fontstringCSS font string (e.g. '12px sans-serif').
selectionColorstringBackground color for selected cells.
selectedTextColorstringText color for selected cells.
headerBackgroundstringBackground color of the header.
headerTextColorstringText color of the header title.

Advanced Header Styles

Enable multi-line headers by setting headerSubTextCount.

PropertyTypeDescription
headerSubTextCount0 | 1 | 2Number of extra lines to show below the title (Units, Description).
headerPlaceholderstringText to show if a sub-field is missing (e.g. "-").
headerTitleStyleHeaderLineStyleStyle for the main column name.
headerUnitsStyleHeaderLineStyleStyle for the units line (if count >= 1).
headerDescriptionStyleHeaderLineStyleStyle for the description line (if count >= 2).

HeaderLineStyle

typescript
interface HeaderLineStyle {
    font?: string;   // e.g. "bold 12px Inter"
    color?: string;  // e.g. "#ff0000"
    alpha?: number;  // 0.0 to 1.0
}

Integrated under the Sci DNA / VeloSci Ecosystem