Skip to main content
A newer version of this page is available. .

AvailableDataSourcesExtension Class

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

Declaration

export class AvailableDataSourcesExtension 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.

var ext = dashboardControl.findExtension('available-data-sources');

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

dashboardControl.unregisterExtension('availableDataSources');

Note

Use the availableDataSources name in your applications so you can change the extension options when calling the control’s option method. Before v20.2 the extension name was available-data-sources. You can use the old name only in the DashboardControl.findExtension method.

Implements

constructor(dashboardControl)

Initializes a new instance of the AvailableDataSourcesExtension class.

Declaration

constructor(
    dashboardControl: DashboardControl
)

Parameters

Name Type
dashboardControl DashboardControl

Properties

dataSources Property

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

Declaration

dataSources: ko.ObservableArray<DataSource>

Property Value

Type
ObservableArray<DataSource>

Remarks

The code snippet below shows how obtain available data sources:

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

name Property

Specifies the unique extension name.

Declaration

name: string

Property Value

Type Description
string

The unique extension name. The return value is ‘available-data-sources’.

Remarks

Use the availableDataSources name in your applications so you can change the extension options when calling the control’s option method. Before v20.2 the extension name was available-data-sources. You can use the old name only in the DashboardControl.findExtension method.

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

selectedDataSources: ko.ObservableArray<DataSource>

Property Value

Type
ObservableArray<DataSource>

templateName Property

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

Declaration

templateName: string

Property Value

Type Description
string

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

viewModel Property

Specifies a view model used to render the AvailableDataSourcesExtension.

Declaration

viewModel: any

Property Value

Type Description
any

An object that specifies a view model used to render the AvailableDataSourcesExtension.

Methods

loadAvailableDataSources Method

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

Declaration

loadAvailableDataSources(): void

start Method

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

Declaration

start(): void

Remarks

See start to learn more.

stop Method

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

Declaration

stop(): void

Remarks

See stop to learn more.