Back to Devexpress

AvailableDataSourcesExtension Class

dashboard-js-devexpress-dot-dashboard-dot-designer-7a74e6e0.md

latest5.9 KB
Original Source

AvailableDataSourcesExtension Class

An extension that provides access to a list of available data sources used to provide data to the Web Dashboard.

Declaration

ts
export class AvailableDataSourcesExtension extends DisposableObject implements IExtension

Remarks

The AvailableDataSourcesExtension allows users to add data sources to the dashboard. Users can add data sources available in a dashboard storage when they click the Add button in the Data Sources page.

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

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

To disable the AvailableDataSourcesExtension, call the unregisterExtension(extensionNames) method and pass the extension’s unique name as a parameter:

javascript
dashboardControl.unregisterExtension('availableDataSources');

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

Implements

IExtension

Inherited Members

dispose

Inheritance

DisposableObject AvailableDataSourcesExtension

constructor(dashboardControl)

Initializes a new instance of the AvailableDataSourcesExtension class.

Declaration

ts
constructor(
    dashboardControl: DevExpress.Dashboard.DashboardControl
)

Parameters

NameTypeDescription
dashboardControlDashboardControl

A Web Dashboard control that owns the extension.

|

Properties

dataSources Property

Gets data sources available to end-users for binding a dashboard to data.

Declaration

ts
dataSources: ko.ObservableArray<DevExpress.Dashboard.Model.DataSource>

Property Value

Type
ObservableArray<DataSource>

Remarks

The code snippet below shows how obtain available data sources:

javascript
var dataSourcesExtension = dashboardControl.findExtension('availableDataSources');
var dataSources = dataSourcesExtension.dataSources();

name Property

Specifies the unique extension name.

Declaration

ts
name: string

Property Value

TypeDescription
string

The unique extension name. The return value is availableDataSources.

|

Remarks

Use the availableDataSources 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.

selectedDataSources Property

Gets data sources currently selected in the Data Sources page.

Declaration

ts
selectedDataSources: ko.ObservableArray<DevExpress.Dashboard.Model.DataSource>

Property Value

TypeDescription
ObservableArray<DataSource>

An array of the DataSource objects that are currently selected data sources.

|

templateName Property

Specifies a name of the knockout template used by the AvailableDataSourcesExtension.

Declaration

ts
templateName: string

Property Value

TypeDescription
string

A string value that specifies a name of the knockout template.

|

viewModel Property

Specifies a view model used to render the AvailableDataSourcesExtension.

Declaration

ts
viewModel: DevExpress.Dashboard.Internal.Designer.AvailableDataSourcesViewModel

Property Value

Type
AvailableDataSourcesViewModel

Methods

loadAvailableDataSources Method

Loads available data sources used to provide data to the Web Dashboard.

Declaration

ts
loadAvailableDataSources(): void

start Method

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

Declaration

ts
start(): void

Remarks

See start to learn more.

stop Method

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

Declaration

ts
stop(): void

Remarks

See stop to learn more.