dashboard-js-devexpress-dot-dashboard-dot-designer-7a74e6e0.md
An extension that provides access to a list of available data sources used to provide data to the Web Dashboard.
export class AvailableDataSourcesExtension extends DisposableObject implements IExtension
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('availableDataSources');
To disable the AvailableDataSourcesExtension, call the unregisterExtension(extensionNames) method and pass the extension’s unique name as a parameter:
dashboardControl.unregisterExtension('availableDataSources');
You can also call the control’s option method to change the extension options.
IExtension
DisposableObject AvailableDataSourcesExtension
Initializes a new instance of the AvailableDataSourcesExtension class.
constructor(
dashboardControl: DevExpress.Dashboard.DashboardControl
)
| Name | Type | Description |
|---|---|---|
| dashboardControl | DashboardControl |
A Web Dashboard control that owns the extension.
|
Gets data sources available to end-users for binding a dashboard to data.
dataSources: ko.ObservableArray<DevExpress.Dashboard.Model.DataSource>
| Type |
|---|
| ObservableArray<DataSource> |
The code snippet below shows how obtain available data sources:
var dataSourcesExtension = dashboardControl.findExtension('availableDataSources');
var dataSources = dataSourcesExtension.dataSources();
Specifies the unique extension name.
name: string
| Type | Description |
|---|---|
| string |
The unique extension name. The return value is availableDataSources.
|
Use the availableDataSources name in the following cases:
Warning
Do not change the unique name of the extension registered in the Web Dashboard to avoid exceptions.
Gets data sources currently selected in the Data Sources page.
selectedDataSources: ko.ObservableArray<DevExpress.Dashboard.Model.DataSource>
| Type | Description |
|---|---|
| ObservableArray<DataSource> |
An array of the DataSource objects that are currently selected data sources.
|
Specifies a name of the knockout template used by the AvailableDataSourcesExtension.
templateName: string
| Type | Description |
|---|---|
| string |
A string value that specifies a name of the knockout template.
|
Specifies a view model used to render the AvailableDataSourcesExtension.
viewModel: DevExpress.Dashboard.Internal.Designer.AvailableDataSourcesViewModel
| Type |
|---|
| AvailableDataSourcesViewModel |
Loads available data sources used to provide data to the Web Dashboard.
loadAvailableDataSources(): void
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.