Skip to main content
A newer version of this page is available. .

UndoRedoExtension Class

A Web Dashboard extension that allows you to keep track of all user actions, and cancel or repeat them.

Declaration

export class UndoRedoExtension extends DisposableObject

Remarks

To get access to the UndoRedoExtension settings, call the control’s findExtension(extensionName) method and pass the extension’s name as a parameter.

var ext = dashboardControl.findExtension('undo-redo');

Note

Use the undoRedo name in your applications so you can change the extension options when calling the control’s option method. Before v20.2 the extension name was undo-redo. You can use the old name only in the DashboardControl.findExtension method.

Implements

Inherited Members

Inheritance

DisposableObject
UndoRedoExtension

constructor(dashboardControl)

Initializes a new instance of the UndoRedoExtension class.

Declaration

constructor(
    dashboardControl: DashboardControl
)

Parameters

Name Type Description
dashboardControl DashboardControl

A Web Dashboard control that owns the extension.

Properties

isChanged Property

Specifies whether the Web Dashboard has unsaved changes.

Declaration

isChanged: ko.Computed<boolean>

Property Value

Type Description
Computed<boolean>

true, if the dashboard has unsaved changes; otherwise, false.

name Property

Specifies the unique extension name.

Declaration

name: string

Property Value

Type Description
string

The unique extension name. The return value is undoRedo.

Remarks

Use the undoRedo name in your applications so you can change the extension options when calling the control’s option method. Before v20.2 the extension name was undo-redo. You can use the old name only in the DashboardControl.findExtension method.

Warning

Do not change the unique name of the extension registered in the Web Dashboard to avoid exceptions.

Methods

processKeyEvent(keyEventType, eventArgs) Method

Allows you to process which key was pressed.

Declaration

processKeyEvent(
    keyEventType: KeyEventType,
    eventArgs: JQueryKeyEventObject
): boolean

Parameters

Name Type Description
keyEventType KeyEventType

The KeyEventType object that identifies a user interaction with the keyboard.

eventArgs JQueryKeyEventObject

A JQueryKeyEventObject object that identifies a key.

Returns

Type Description
boolean

true, if a key used to undo the operation; otherwise, false.

redo Method

Declaration

redo(): void

redoEnabled Method

Declaration

redoEnabled(): boolean

Returns

Type
boolean

reset Method

Declaration

reset(): void

start Method

Contains code that is executed when you register the dashboard extension.

Declaration

start(): void

stop Method

Contains code that is executed when you unregister the dashboard extension.

Declaration

stop(): void

undo Method

Declaration

undo(): void

undoEnabled Method

Declaration

undoEnabled(): boolean

Returns

Type
boolean