dashboard-js-devexpress-dot-dashboard-dot-designer.md
A Web Dashboard extension that allows you to create a new dashboard.
export class CreateDashboardExtension implements IExtension
When registered, the CreateDashboardExtension adds the “New…” item to the dashboard menu.
To get access to the CreateDashboardExtension settings, call the control’s findExtension(extensionName) method and pass the extension’s name as a parameter.
var ext = dashboardControl.findExtension('createDashboard');
To remove this item from the menu, call the unregisterExtension(extensionNames) method and pass the extension’s unique name as a parameter:
dashboardControl.unregisterExtension('createDashboard');
You can also call the control’s option method to change the extension options.
IExtension
Initializes a new instance of the CreateDashboardExtension class.
constructor(
dashboardControl: DevExpress.Dashboard.DashboardControl
)
| Name | Type | Description |
|---|---|---|
| dashboardControl | DashboardControl |
A Web Dashboard control that owns the extension.
|
Specifies the unique extension name.
name: string
| Type | Description |
|---|---|
| string |
The unique extension name. The return value is createDashboard.
|
Use the createDashboard name in the following cases:
Warning
Do not change the unique name of the extension registered in the Web Dashboard to avoid exceptions.
Opens the “New…” dashboard menu page.
showCreateNewDashboard: () => void
| Type |
|---|
| () => void |
Note that the dashboard menu is available if Web Dashboard operates in the designer mode.
Creates a new dashboard with a specified name and JSON model.
performCreateDashboard(
dashboardName: string,
dashboardJson: string
): JQueryPromise<void>
| Name | Type | Description |
|---|---|---|
| dashboardName | string |
The name of the created dashboard.
| | dashboardJson | string |
A dashboard model encoded in the JSON format.
|
| Type | Description |
|---|---|
| JQueryPromise<void> |
A JQuery Promise object that is resolved after the action is completed.
|
The following code creates a copy of the opened dashboard with the New Dashboard name:
var extCreateDashboard = dashboardControl.findExtension("createDashboard");
var dashboardName = "New Dashboard";
extCreateDashboard.performCreateDashboard(dashboardName, dashboardControl.dashboard().getJSON());
To create a new dashboard, pass an empty model as a parameter:
extCreateDashboard.performCreateDashboard(dashboardName, new DevExpress.Dashboard.Model.Dashboard({}));
Registers the CreateDashboardExtension extension.
start(): void
Contains code that is executed when you unregister the dashboard extension.
stop(): void