Back to Devexpress

SaveDashboardExtension Class

dashboard-js-devexpress-dot-dashboard-dot-designer-260f127c.md

latest5.1 KB
Original Source

SaveDashboardExtension Class

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

Declaration

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

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

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

javascript
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

ts
constructor(
    dashboardControl: DevExpress.Dashboard.DashboardControl
)

Parameters

NameTypeDescription
dashboardControlDashboardControl

A Web Dashboard control that owns the extension.

|

Properties

canSaveDashboard Property

Declaration

ts
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

ts
designerToViewerAction: DevExpress.Dashboard.SequenceAction

Property Value

TypeDescription
SequenceAction

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

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

Parameters

NameTypeDescription
action() => void

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

|

performSaveDashboard(dashboardId, dashboardJson) Method

Calls the saveDashboard method.

Declaration

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

Parameters

NameTypeDescription
dashboardIdstring

A string that identifies the dashboard.

| | dashboardJson | string |

A dashboard model encoded in the JSON format.

|

Returns

TypeDescription
JQueryPromise<any>

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

|

saveDashboard Method

Saves the current dashboard.

Declaration

ts
saveDashboard(): JQueryPromise<any>

Returns

TypeDescription
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

ts
start(): void

stop Method

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

Declaration

ts
stop(): void