Skip to main content

IExtension Interface

The Web Dashboard extension.

#Declaration

TypeScript
export interface IExtension

#Remarks

The JavaScript extensions allow you to customize and provide certain functionality to the Web Dashboard control. You can include or exclude the required control functionality using extensions.

#Properties

#designerToViewerAction Property

Specifies an action executed at the moment of switching from Designer to Viewer.

#Declaration

TypeScript
designerToViewerAction?: SequenceAction

#Property Value

Type Description
SequenceAction

Specifies an action executed at the moment of switching from Designer to Viewer.

#name Property

Specifies the unique extension name.

#Declaration

TypeScript
name: string

#Property Value

Type Description
string

The unique extension name.

#Remarks

Warning

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

#viewerToDesignerAction Property

Specifies an action executed at the moment of switching from Viewer to Designer.

#Declaration

TypeScript
viewerToDesignerAction?: SequenceAction

#Property Value

Type Description
SequenceAction

An action executed at the moment of switching from Viewer to Designer.

#Methods

#processKeyEvent(keyEventType, eventArgs) Method

Allows you to process which key was pressed.

#Declaration

TypeScript
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

A bool value.

#start Method

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

#Declaration

TypeScript
start?(): void

#Remarks

Use the stop method to describe code that is invoked when you unregister the dashboard extension.

The code snippet below demonstrates how to describe adding the custom ‘Save As’ extension to the Web Dashboard when you register it in the control, and how to describe removing the created extension when you unregister it.

JavaScript
// ... 
function SaveAsDashboardExtension(dashboardControl) {
    this.name = "save-as";
    this.toolbox = this.dashboardControl.findExtension("toolbox");

    this._menuSaveAsItem = new DevExpress.Dashboard.DashboardMenuItem("save-as", "Save As...", 120, 0, function() { /*...*/ });
}

SaveAsDashboardExtension.start = function () {
    this.toolbox.menuItems.push(this._menuSaveAsItem);    
};
SaveAsDashboardExtension.stop = function () {
    this.toolbox.menuItems.remove(this._menuSaveAsItem);
};
// ... 

Note

To register or unregister extensions from the Web Dashboard control, use the registerExtension(extensions) and unregisterExtension(extensionNames) methods, respectively.

Refer to the Manipulating an observableArray section in the KnockoutObservableArray for more information about knockout methods.

#stop Method

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

#Declaration

TypeScript
stop?(): void

#Remarks

Use the start method to describe code that is invoked when you register the dashboard extension.

The code snippet below demonstrates how to describe adding the custom ‘Save As’ extension to the Web Dashboard when you register it in the control, and how to describe removing the created extension when you unregister it.

JavaScript
// ... 
function SaveAsDashboardExtension(dashboardControl) {
    this.name = "save-as";
    this.toolbox = this.dashboardControl.findExtension("toolbox");

    this._menuSaveAsItem = new DevExpress.Dashboard.DashboardMenuItem("save-as", "Save As...", 120, 0, function() { /*...*/ });
}

SaveAsDashboardExtension.start = function () {
    this.toolbox.menuItems.push(this._menuSaveAsItem);    
};
SaveAsDashboardExtension.stop = function () {
    this.toolbox.menuItems.remove(this._menuSaveAsItem);
};
// ... 

Note

To register or unregister extensions from the Web Dashboard control, use the registerExtension(extensions) and unregisterExtension(extensionNames) methods, respectively.

Refer to the Manipulating an observableArray section in the KnockoutObservableArray for more information about knockout methods.