dashboard-js-devexpress-dot-dashboard-fb62e20f.md
The Dashboard Panel extension that displays a list of available dashboards and lets you switch between the designer and viewer modes.
export class DashboardPanelExtension implements IExtension
Use the following code to register the DashboardPanelExtension extension and enable the Dashboard Panel:
// The dashboardControl variable is the obtained DashboardControl instance.
dashboardControl.registerExtension(new DashboardPanelExtension(dashboardControl));
IExtension
Initializes a new instance of the DashboardPanelExtension class.
constructor(
dashboardControl: DevExpress.Dashboard.DashboardControl,
options?: DashboardPanelExtensionOptions
)
| Name | Type | Description |
|---|---|---|
| dashboardControl | DashboardControl |
A Web Dashboard control that owns the extension.
| | options | DashboardPanelExtensionOptions |
A DashboardPanelExtensionOptions object that contains the extension options.
|
Specifies whether the Dashboard Panel allows end-users to switch the Web Dashboard from the Viewer to Designer mode.
allowSwitchToDesigner: ko.Observable<boolean>
| Type | Description |
|---|---|
| Observable<boolean> |
true , if the Dashboard Panel allows end-users to switch from the Viewer to Designer mode; otherwise, false.
|
When the allowSwitchToDesigner property is set to true , the Dashboard Panel displays the Edit in Designer button that allows an end-user to edit the currently selected dashboard.
Note
The allowSwitchToDesigner option is not in effect when the Web Dashboard operates in the ViewerOnly mode.
Gets an array of dashboards displayed in the Dashboard Panel.
availableDashboards: ko.ObservableArray<DevExpress.Dashboard.DashboardInfo>
| Type | Description |
|---|---|
| ObservableArray<DashboardInfo> |
An array of the DashboardInfo objects that contain information about dashboards displayed in the Dashboard Panel.
|
To display the actual list of dashboards available in the dashboard storage, use the updateDashboardsList method.
Specifies an action executed at the moment of switching from Designer to Viewer.
designerToViewerAction: DevExpress.Dashboard.SequenceAction
| Type | Description |
|---|---|
| SequenceAction |
An action executed at the moment of switching from Designer to Viewer.
|
Hides the Dashboard Panel asynchronously.
hidePanelAsync: (options: DevExpress.Dashboard.WorkingModeSwitchingOptions) => JQueryPromise<{}>
| Type | Description |
|---|---|
| (options: WorkingModeSwitchingOptions) => JQueryPromise<> |
The WorkingModeSwitchingOptions object that returns a JQuery promise.
|
The code below hides the Dashboard Panel asynchronously and then adjusts the left indent of the DashboardControl using the surfaceLeft property.
function hideDashboardPanel() {
// The dashboardControl variable is the obtained DashboardControl instance.
var dashboardPanelExtension = dashboardControl.findExtension('dashboardPanel');
dashboardPanelExtension.hidePanelAsync({}).done(function (e) {
dashboardControl.surfaceLeft(e.surfaceLeft);
});
}
Specifies the unique extension name.
name: string
| Type | Description |
|---|---|
| string |
The unique extension name. The return value is ‘dashboardPanel’.
|
Warning
Do not change the unique name of the extension registered in the Web Dashboard to avoid exceptions.
Specifies the Dashboard Panel’s width.
panelWidth: number
| Type | Description |
|---|---|
| number |
An integer value that specifies the Dashboard Panel’s width (in pixels).
|
selectedItemKeys: ko.ObservableArray<string>
| Type |
|---|
| ObservableArray<string> |
Invokes the Dashboard Panel asynchronously.
showPanelAsync: (options: DevExpress.Dashboard.WorkingModeSwitchingOptions) => JQueryPromise<{}>
| Type | Description |
|---|---|
| (options: WorkingModeSwitchingOptions) => JQueryPromise<> |
The WorkingModeSwitchingOptions object that returns a JQuery promise.
|
The code below invokes the Dashboard Panel asynchronously and then adjusts the left indent of the DashboardControl using the surfaceLeft property.
function showDashboardPanel() {
// The dashboardControl variable is the obtained DashboardControl instance.
var dashboardPanelExtension = dashboardControl.findExtension('dashboardPanel');
dashboardPanelExtension.showPanelAsync({}).done(function (e) {
dashboardControl.surfaceLeft(e.surfaceLeft);
});
}
Switches the Web Dashboard to the Designer mode.
switchToDesigner: () => void
| Type | Description |
|---|---|
| () => void |
A function that is executed when you switch the Web Dashboard’s working mode to Designer.
|
Use the switchToViewer method to switch the Web Dashboard to Viewer mode.
Switches the Web Dashboard to the Viewer mode.
switchToViewer: () => void
| Type | Description |
|---|---|
| () => void |
A function that is executed when you switch the Web Dashboard’s working mode to Viewer.
|
Use the switchToDesigner method to switch the Web Dashboard to the Designer mode.
Specifies an action executed at the moment of switching from Viewer to Designer.
viewerToDesignerAction: DevExpress.Dashboard.SequenceAction
| Type | Description |
|---|---|
| SequenceAction |
An action executed at the moment of switching from Viewer to Designer.
|
Specifies whether the Dashboard Panel is visible.
visible: ko.Observable<boolean>
| Type | Description |
|---|---|
| Observable<boolean> |
true , to display the Dashboard Panel; otherwise, false.
|
Contains code that is executed when you register the dashboard extension.
start(): void
See start to learn more.
Contains code that is executed when you unregister the dashboard extension.
stop(): void
See stop to learn more.
Updates the dashboard list based on the dashboards available in the dashboard storage.
updateDashboardsList(): void
You can obtain the list of available dashboards using the availableDashboards property.