Skip to main content

SaveDashboardExtension Class

A Web Dashboard extension that allows you to save the current dashboard.

Declaration

export class SaveDashboardExtension implements IExtension

Remarks

When registered, the SaveDashboardExtension adds the “Save” item to the dashboard menu.

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

var ext = dashboardControl.findExtension('saveDashboard');

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

dashboardControl.unregisterExtension('saveDashboard');

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

Implements

IExtension

constructor(dashboardControl)

Initializes a new instance of the SaveDashboardExtension class.

Declaration

constructor(
    dashboardControl: DevExpress.Dashboard.DashboardControl
)

Parameters

Name Type Description
dashboardControl DashboardControl

A Web Dashboard control that owns the extension.

Properties

canSaveDashboard Property

Declaration

canSaveDashboard: ko.Computed<boolean>

Property Value

Type
Computed<boolean>

designerToViewerAction Property

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

Declaration

designerToViewerAction: DevExpress.Dashboard.SequenceAction

Property Value

Type Description
SequenceAction

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

name Property

Specifies the unique extension name.

Declaration

name: string

Property Value

Type Description
string

The unique extension name. The return value is saveDashboard.

Remarks

Use the saveDashboard 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

ensureDashboardSaved(action) Method

Allows you to invoke a custom function while you save a dashboard.

Declaration

ensureDashboardSaved(
    action: () => void
): void

Parameters

Name Type Description
action () => void

A function that is executed when the dashboard is about to be saved.

performSaveDashboard(dashboardId, dashboardJson) Method

Calls the saveDashboard method.

Declaration

performSaveDashboard(
    dashboardId: string,
    dashboardJson: string
): JQueryPromise<any>

Parameters

Name Type Description
dashboardId string

A string that identifies the dashboard.

dashboardJson string

A dashboard model encoded in the JSON format.

Returns

Type Description
JQueryPromise<any>

A JQuery Promise object that is resolved after the action is completed.

saveDashboard Method

Saves the current dashboard.

Declaration

saveDashboard(): JQueryPromise<any>

Returns

Type Description
JQueryPromise<any>

A JQuery Promise object that is resolved after the dashboard is saved.

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