DataGridXL - API

UndoManager

Description

The UndoManager maintains a history of user actions for undo and redo functionality.

NOTE: In most cases, using the undo and redo methods on the DataGridXL instance directly is preferred.

Usage

Your DataGridXL instance contains a property undoManager.

javascript
// create DataGridXL instance
const grid = new DataGridXL(...);
// work with the UndoManager instance
grid.undoManager.getCommands();
NOTE: You don't need to create an UndoManager instance yourself — it is provided by the grid automatically.

Methods

add(command)

Add command

Arguments

command
functionCommand function
clear()

Clear all commands

getCommands(): array

Get commands

ReturnsarrayArray of commands
getIndex(): number

Get index

ReturnsnumberIndex
hasRedo(): boolean

Check if has redo

Returnsboolean
hasUndo(): boolean

Check if has undo

Returnsboolean
redo()

Redo last command

setCallback(callbackFunction)

Set callback function

Arguments

callbackFunction
functionCallback function
setLimit(limit)

Set a limit

Arguments

limit
numberLimit
undo()

Undo last command

No generated events found for UndoManager.