Back to Devexpress

UndoRedoExtension Class

dashboard-js-devexpress-dot-dashboard-dot-designer-7db6b3df.md

latest5.1 KB
Original Source

UndoRedoExtension Class

A Web Dashboard extension that adds the undo/redo buttons and allows users to keep track of user actions, and cancel or repeat them.

Declaration

ts
export class UndoRedoExtension extends DisposableObject

Remarks

When registered, the UndoRedoExtension adds the undo/redo buttons to the designer toolbar.

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

javascript
var ext = dashboardControl.findExtension('undoRedo');

To remove this item from the menu, call the unregisterExtension(extensionNames) method and pass the extension’s unique name as a parameter:

javascript
dashboardControl.unregisterExtension('undoRedo');

You can also call the control’s option method to change the extension options.

Inherited Members

dispose

Inheritance

DisposableObject UndoRedoExtension

constructor(dashboardControl)

Initializes a new instance of the UndoRedoExtension class.

Declaration

ts
constructor(
    dashboardControl: DevExpress.Dashboard.DashboardControl
)

Parameters

NameTypeDescription
dashboardControlDashboardControl

A Web Dashboard control that owns the extension.

|

Properties

isChanged Property

Specifies whether the Web Dashboard has unsaved changes.

Declaration

ts
isChanged: ko.Computed<boolean>

Property Value

TypeDescription
Computed<boolean>

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

|

name Property

Specifies the unique extension name.

Declaration

ts
name: string

Property Value

TypeDescription
string

The unique extension name. The return value is undoRedo.

|

Remarks

Use the undoRedo name in the following cases:

  • Call the DashboardControl.findExtension method and pass the extension name as a parameter to access the extension.
  • Call the control’s option method to change the extension options.

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

ts
processKeyEvent(
    keyEventType: DevExpress.Dashboard.KeyEventType,
    eventArgs: JQueryKeyEventObject
): boolean

Parameters

NameTypeDescription
keyEventTypeKeyEventType
eventArgsJQueryKeyEventObject

A JQueryKeyEventObject object that identifies a key.

|

Returns

TypeDescription
boolean

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

|

redo Method

Reapplies the last undone operation.

Declaration

ts
redo(): void

redoEnabled Method

Specifies whether the Redo button is enabled.

Declaration

ts
redoEnabled(): boolean

Returns

TypeDescription
boolean

true to enable the Redo button; otherwise, false.

|

reset Method

Deletes all of the Undo and Redo history data.

Declaration

ts
reset(): void

start Method

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

Declaration

ts
start(): void

stop Method

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

Declaration

ts
stop(): void

undo Method

Undoes the last operation.

Declaration

ts
undo(): void

undoEnabled Method

Specifies whether the Undo button is enabled.

Declaration

ts
undoEnabled(): boolean

Returns

TypeDescription
boolean

true to enable the Undo button; otherwise, false.

|