v5.20192.631
|

UndoStack Class

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

Hierarchy

  • 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.

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

  • Raises the {link @addedTarget} event.

    Parameters

    Returns void

onAddingAction

onAddingTarget

  • Raises the addingTarget event.

    Parameters

    Returns boolean

    True if the event was not canceled.

onRedoingAction

onStateChanged

  • onStateChanged(): void

onUndoingAction

redo

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

    Returns void

undo

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

    Returns void

Events

addedAction

addedAction: Event

Occurs after an UndoableAction had been added to the stack.

addedTarget

addedTarget: Event

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

addingAction

addingAction: Event

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

addingTarget

addingTarget: Event

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

redoingAction: Event

Occurs when an UndoableAction is about to be redone.

redoneAction

redoneAction: Event

Occurs after an UndoableAction has been redone.

param

UndoActionEventArgs that contains the event data.

stateChanged

stateChanged: Event

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

undoingAction: Event

Occurs when an UndoableAction is about to be undone.

undoneAction

undoneAction: Event

Occurs after an UndoableAction has been undone.

param

UndoActionEventArgs that contains the event data.