Undo & Redo
Enable history on client-side grids to support Ctrl/Cmd+Z (undo) and Ctrl/Cmd+Y / Ctrl/Cmd+Shift+Z (redo) across single-cell edits and multi-cell clipboard or fill batches.
Configuration & API
Section titled “Configuration & API”const grid = new Grid<Order>({ container, columnDefs, rowData, getRowId: (row) => row.id, history: { maxEntries: 100, maxRows: 10_000, maxCells: 50_000, },});
if (grid.canUndo()) grid.undo();if (grid.canRedo()) grid.redo();const stats = grid.getHistoryState(); // { enabled, undoCount, redoCount, retainedRows, retainedCells, version }grid.clearHistory();Behavior & Reset Rules
Section titled “Behavior & Reset Rules”- Batched Operations: Multi-cell paste, cut, delete, and drag-fill record as a single history entry (
historyChangedfires withreason: 'record' | 'undo' | 'redo' | 'clear' | 'dataChange' | 'limit'). - What Clears History: Calling
setRowData,setRowSource,refreshRows, orsetColumnDefswith value-function changes clears the undo/redo stack (reason: 'dataChange'). - Client-Only Constraint:
historycannot be enabled on remote models ('infinite','serverSide','viewport').