Edit history
Undo or redo cell edits.
Options
Changes below update the Grid and code immediately.
Edit a Quantity cell and press Enter. Remember the before and after values.
View code
Sample data included in the code · 6 rows
Usage guide
#Restore an accidentally changed quantity or reapply an undone edit.
Try it yourself
- Create edit history
Edit a Quantity cell and press Enter. Remember the before and after values.
- Undo
Click Undo above the table to restore the previous value. The button is disabled when no edit can be undone.
- Redo
Click Redo to reapply the edit. The total changes to match the quantity.
Move between previous and changed values for the same order and inspect undo()/redo() results.
New edits and resetting affect history. This does not automatically undo data already saved on the server.
Useful terms
- undo / redo
- Undo the last edit / reapply an undone edit.
- getUndoRedoDepth
- Reads available undo and redo history counts.
Key API examples
Application code that references the registered Grid element as grid.
await grid.undo();
await grid.redo();
console.log(await grid.getUndoRedoDepth());API reference
#Events1
| Events | Detail type | Description |
|---|---|---|
GridHistoryChangedDetail | Fires when the undo/redo stack mutates. |
Methods4
| Method / Arguments | Return type | Description |
|---|---|---|
Promise<boolean> | Undo the most recent recorded transaction. | |
Promise<boolean> | Redo the most recently undone transaction. | |
Promise<void> | Clear undo and redo history. | |
Promise<{ undo: number; redo: number }> | Read the current undo and redo stack depths. |
Explore each feature
Learn when to use each feature and how to configure it. Each guide identifies live examples and features you connect in your app.