Skip to content
Sheetwrite

Sheetwrite / Documentation

GridAdapterEventHandlers@sheetwrite/core/adapter

Framework-neutral readiness, change, and error callbacks shared by adapters.

Framework-neutral readiness, change, and error callbacks shared by adapters.

Members 15

onGridChange

onGridChange Receives every committed Grid change, including its applied transaction.
onGridChange?: (event: ChangeEvent) => void;
onRowDelta Receives projected host-row effects when a row bridge is attached.
onRowDelta?: RowBridgeHandler<Id>;
onSelectionChange Receives the current selection, or null after it is cleared.
onSelectionChange?: (selection: Selection | null) => void;
onViewportChange Receives visible row bounds and vertical scroll offset after scrolling.
onViewportChange?: (event: GridEvents["scroll"]) => void;
onEditBegin Fires when cell editing begins.
onEditBegin?: (event: GridEvents["edit-begin"]) => void;
onEditCommit Fires after an edit commits its parsed cell value.
onEditCommit?: (event: GridEvents["edit-commit"]) => void;
onActiveSheetChange Fires after the visible sheet changes.
onActiveSheetChange?: (event: GridEvents["active-sheet"]) => void;
onCommandStateChange Receives observable undo/redo and formatting command state.
onCommandStateChange?: (event: GridEvents["command-state-change"]) => void;
onMutationRejected Receives structured issues when a Grid mutation is rejected.
onMutationRejected?: (event: GridEvents["mutation-rejected"]) => void;
onRendererFallback Fires when worker rendering falls back to the main-thread canvas renderer.
onRendererFallback?: (event: GridEvents["renderer-fallback"]) => void;
onDatasourceError Receives failed datasource requests and their errors.
onDatasourceError?: (event: GridEvents["datasource-error"]) => void;
onExportError Receives failures from built-in XLSX export actions.
onExportError?: (event: GridEvents["export-error"]) => void;
onReady Fires after the adapter publishes a ready Grid generation.
onReady?: (event: GridReadyEvent) => void;
onInitializationError Receives a WASM initialization failure while the adapter remains mounted.
onInitializationError?: (error: SheetwriteError) => void;

Declaration

View full TypeScript declaration
export interface GridAdapterEventHandlers<
Id extends RowBridgeId = RowBridgeId,
> {
onGridChange?: (event: ChangeEvent) => void;
onRowDelta?: RowBridgeHandler<Id>;
onSelectionChange?: (selection: Selection | null) => void;
onViewportChange?: (event: GridEvents["scroll"]) => void;
onEditBegin?: (event: GridEvents["edit-begin"]) => void;
onEditCommit?: (event: GridEvents["edit-commit"]) => void;
onSearch?: (result: GridEvents["search"]) => void;
onActiveSheetChange?: (event: GridEvents["active-sheet"]) => void;
onCommandStateChange?: (event: GridEvents["command-state-change"]) => void;
onMutationRejected?: (event: GridEvents["mutation-rejected"]) => void;
onRendererFallback?: (event: GridEvents["renderer-fallback"]) => void;
onDatasourceError?: (event: GridEvents["datasource-error"]) => void;
onExportError?: (event: GridEvents["export-error"]) => void;
onReady?: (event: GridReadyEvent) => void;
onInitializationError?: (error: SheetwriteError) => void;
}