Back to Devexpress

IExtension Interface

dashboard-js-devexpress-dot-dashboard-06087c1f.md

latest7.6 KB
Original Source

IExtension Interface

The Web Dashboard extension.

Declaration

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

Inheritance

Show 21 items

IExtension AvailableDataSourcesExtension

AvailableFontFamiliesExtension

ChartIndicatorsExtension

ConversionPanelExtension

CreateDashboardExtension

DashboardColorSchemeEditorExtension

DashboardCurrencyEditorExtension

DashboardPanelExtension

DashboardParameterEditorExtension

DashboardTitleEditorExtension

DataSourceBrowserExtension

FilterPanelExtension

InteractivityPanelExtension

KeyboardNavigationExtension

LayoutOptionEditorExtension

OpenDashboardExtension

SaveDashboardExtension

ToolboxExtension

UrlStateExtension

ICustomItemExtension

Properties

designerToViewerAction Property

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

Declaration

ts
designerToViewerAction?: SequenceAction

Property Value

TypeDescription
SequenceAction

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

|

name Property

Specifies the unique extension name.

Declaration

ts
name: string

Property Value

TypeDescription
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

ts
viewerToDesignerAction?: SequenceAction

Property Value

TypeDescription
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

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

Parameters

NameTypeDescription
keyEventTypeKeyEventType

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

| | eventArgs | JQueryKeyEventObject |

A JQueryKeyEventObject object that identifies a key.

|

Returns

TypeDescription
boolean

A bool value.

|

start Method

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

Declaration

ts
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

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