Undo/Redo Management: Automatically tracks user changes with the ability to undo/redo actions using keyboard shortcuts.
Configurable Stack Size: Tracks up to 200 changes by default, and accepts partial history config when you only need to override one option.
Provider Persistence: Can load and save stack state through local cache and custom server providers for same-dataset sessions.
Custom Event Hooks: Supports custom behavior via beforeundo and beforeredo events, allowing full control over the undo/redo process.
Pro Editing Coverage: Tracks regular cell edits, Pro editor templates, textarea editors, range edits, clipboard paste, autofill, row-edit saves, and audit restore replays when paired with EventManagerPlugin.
Use EventManagerPlugin together with HistoryPlugin.
HistoryPlugin listens to ON_EDIT_EVENT, which is emitted by
EventManagerPlugin.
1
import {
2
EventManagerPlugin,
3
HistoryPlugin,
4
createLocalStorageHistoryAdapter,
5
} from'@revolist/revogrid-pro';
6
7
plugins = [EventManagerPlugin, HistoryPlugin];
Undo, redo, and public replay operations emit beforehistedit. When EventManagerPlugin is installed, it handles that event and emits the normal gridedit flow. When it is not installed, History applies the replay directly with setRangeData.
AuditHistoryPlugin automatically reuses or installs HistoryPlugin for restore replay, keyboard shortcuts, and existing History integrations. Keep History configuration on grid.history; Audit History does not define a nested History config.
grid.history is optional. Add it only when you need custom stacks, a smaller
or larger stack limit, or an initially disabled plugin.
Undo and redo stacks are index-based, so persisted history is safe only when the user returns to the same dataset and row order. For long-term recovery across changing data, use AuditHistoryPlugin, which restores by stable row identity.
Use sourceId to reject stale server states. With multiple providers, the plugin loads the first provider immediately, then applies later providers only when their updatedAt state is newer and their sourceId is compatible.
When storage is configured, clearOnSourceChange defaults to false so the initial data load does not erase the restored stack. Set it to true only when your app wants every source replacement to clear persisted undo/redo state.
For custom controls, listen to historychanged instead of reading plugin
internals. The event detail includes undoStackSize, redoStackSize,
canUndo, canRedo, and disabled.
Undo/redo does not record changes: ensure plugin order is
[EventManagerPlugin, HistoryPlugin].
Restore flashes are missing in Audit History: install EventManagerPlugin and CellFlashPlugin; Audit restore replay flows through beforehistedit and the normal edit event path.
Calling plugin methods does not work: call getPlugins() first, then find
HistoryPlugin.
History clears after sort, filter, row-order, or source replacement: this is
intentional because those operations can change visible row indexes.
Persisted history was skipped: check the historyerror event for a
storage-source-mismatch phase and update the configured sourceId.
Need a known-good reference: see code in:
revogrid-pro/src/components/history/**.**.
The plugin listens to edit events (onEditEvent) and tracks changes in undo and redo stacks. Keyboard shortcuts like Ctrl+Z for undo and Ctrl+Y (or Ctrl+Shift+Z) for redo are supported out of the box. You can customize its behavior by using the BEFORE_UNDO_EVENT and BEFORE_REDO_EVENT hooks.
Here’s a quick snippet showing how the plugin processes undo actions:
replayChange() emits beforehistedit first. If no integration handles that event, History falls back to providers.data.setRangeData(...).
Try it Out!
Add the History Plugin to your RevoGrid instance and experience seamless undo/redo functionality. This plugin is especially useful in applications that handle complex data operations, ensuring users can easily revert or reapply changes as needed.