The requested page is not available for the requested platform. You are viewing the content for Default platform.

IExtension Interface

The Web Dashboard extension.

Declaration

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

Declaration

designerToViewerAction?: SequenceAction

Property Value

Type Description
SequenceAction

name Property

Specifies a unique extension name.

Declaration

name: string

Property Value

Type Description
string

A unique extension name.

Remarks

Warning

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

viewerToDesignerAction Property

Declaration

viewerToDesignerAction?: SequenceAction

Property Value

Type Description
SequenceAction

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

A bool value.

start Method

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

Declaration

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.

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

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.

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