Error Handling
NextGrid isolates cell callback and I/O failures so a broken getter, formatter, or datasource request never crashes the grid.
Cell Error Isolation & error Event
Section titled “Cell Error Isolation & error Event”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);});GridErrorOperation Categories
Section titled “GridErrorOperation Categories”| 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 |
API Exceptions vs. Graceful Rejections
Section titled “API Exceptions vs. Graceful Rejections”- Synchronous
throw: Invalid construction options, missing required modules (ExportModule,ClipboardModule), invalidsetColumnDefs/applyStatetransactions, or calling methods afterdestroy()throw immediately without mutating state. - Boolean /
nullReturns: Navigation, focus, and selection commands (setFocusedCell,setRowSelected,setCellRange,cancelEditing) returnfalseornullwhen a target is unavailable or ineligible. - Overlays: Terminal datasource errors surface in
.grid-overlay-wrapper(overlayError).