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 remove this item from the menu, call the unregisterExtension(extensionNames) method and pass the extension’s unique name as a parameter:
dashboardControl.unregisterExtension('save-dashboard');
Implements
constructor(dashboardControl)
Initializes a new instance of the SaveDashboardExtension
class.
Declaration
constructor(
dashboardControl: 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
Declaration
designerToViewerAction: SequenceAction
Property Value
Type |
---|
SequenceAction |
name Property
Specifies a unique extension name.
Declaration
name: string
Property Value
Type | Description |
---|---|
string | A unique extension name. The return value is ‘save-dashboard’. |
Remarks
Warning
Do not change a unique name of the extension registered in the Web Dashboard in order 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