Skip to content

Error Handling

NextGrid isolates cell callback and I/O failures so a broken getter, formatter, or datasource request never crashes the grid.

Exceptions inside valueGetter or formatter are caught per cell. Affected cells display with --next-grid-cell-error-bg, --next-grid-cell-error-text, and --next-grid-cell-error-outline while the rest of the grid stays interactive:

grid.addEventListener('error', (event) => {
console.error(event.operation, event.colId, event.sourceIndices, event.message);
});
Category GridErrorOperation Values
Data & Processing valueGetter, formatter, comparator, quickFilterTextGetter, sort, filter, rowIdentity, aggregateFormatter
Editing & Mutations isEditable, valueParser, valueValidator, valueSetter, valueEquals, valueMutation, editorFactory, editorMount, editorStart, editorFocus, editorGetValue, editorValidate, editorCommit, editorCancel, editorDestroy
Custom Renderers rendererFactory, rendererMount, rendererUpdate, rendererDestroy
Clipboard, Fill & Menus clipboardRead, clipboardWrite, clipboardData, fill, columnMenuProvider, columnMenuAction, columnMenuCommand, bodyMenuProvider, bodyMenuAction
Export & Remote export, datasource
  • Synchronous throw: Invalid construction options, missing required modules (ExportModule, ClipboardModule), invalid setColumnDefs/applyState transactions, or calling methods after destroy() throw immediately without mutating state.
  • Boolean / null Returns: Navigation, focus, and selection commands (setFocusedCell, setRowSelected, setCellRange, cancelEditing) return false or null when a target is unavailable or ineligible.
  • Overlays: Terminal datasource errors surface in .grid-overlay-wrapper (overlayError).