5.20231.904
wijmo.undo Class UndoStack Wijmo API Class

UndoStack Class

Class that provides undo/redo functionality for input elements and Wijmo controls.

Heirarchy

  • UndoStack

Constructors

constructor

  • new UndoStack(target?: any, options?: any): UndoStack
  • Initializes a new instance of the UndoStack class.

    Parameters

    • Optional target: any

      The DOM element or CSS selector for the DOM elements to be added to UndoStack context. If not provided, the whole document body is added to the context.

    • Optional options: any

      The JavaScript object containing initialization data for the UndoStack.

    Returns UndoStack

Properties

actionCount

actionCount: number

Gets the number of actions currently stored in the UndoStack.

autoKeyboard

autoKeyboard: boolean

Gets or sets a value that determines whether the UndoStack should monitor the keyboard and handle the undo/redo keys (ctrl+Z/ctrl+Y) automatically.

canRedo

canRedo: boolean

Gets a value that determines whether the UndoStack is ready to redo an action.

canUndo

canUndo: boolean

Gets a value that determines whether the UndoStack is ready to undo an action.

isDisabled

isDisabled: boolean

Gets or sets a vlue that determines whether the UndoStack is currently disabled.

maxActions

maxActions: number

Gets or sets the maximum number of actions to store in the UndoStack.

The default value for this property is 1,000 actions.

Methods

addTarget

  • addTarget(target: any): boolean
  • Adds an undo/redo target to the UndoStack context.

    Parameters

    • target: any

      Query selector or element to add to the UndoStack context.

    Returns boolean

clear

  • clear(): void

onAddedAction

onAddedTarget

onAddingAction

onAddingTarget

onRedoingAction

onRedoneAction

onStateChanged

  • onStateChanged(): void

onUndoingAction

onUndoneAction

pushAction

redo

  • redo(): void
  • Redoes the last action undone.

    Returns void

undo

  • undo(): void
  • Undoes the last action recorded.

    Returns void

Events

addedAction

Occurs after an UndoableAction had been added to the stack.

addedTarget

Occurs after an element has been added to the UndoStack context.

addingAction

Occurs when an UndoableAction is about to be added to the stack.

addingTarget

Occurs when an element is about to be added to the UndoStack context.

Listeners may prevent the element from being added to the context by setting the cancel parameter to true.

redoingAction

Occurs when an UndoableAction is about to be redone.

redoneAction

Occurs after an UndoableAction has been redone.

param

UndoActionEventArgs that contains the event data.

stateChanged

stateChanged: Event<UndoStack, EventArgs>

Occurs when the state of the UndoStack changes.

Use this event to update UI elements that reflect the state of the UndoStack. For example, to enable or disable undo/redo buttons.

undoingAction

Occurs when an UndoableAction is about to be undone.

undoneAction

Occurs after an UndoableAction has been undone.

param

UndoActionEventArgs that contains the event data.