Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: DataSourceProxy

require(["esri/opsdashboard/DataSourceProxy"], function(DataSourceProxy) { /* code goes here */ });

Description

(Added at v3.14)
(Currently in Mature Support) DataSourceProxy is a proxy class that represents a operations dashboard data source. Data source instances cannot be directly instantiated. To get a particular data source, extension mixins functions getDataSourceProxy or getDataSourceProxies should be used. The most commonly used function of data source is executeQuery.

Samples

Search for samples that use this class.

Properties

NameTypeSummary
displayFieldNameStringRead-only: The name of the display field.
fieldsField[]Read-only: The collection of fields.
geometryTypeStringRead-only: The geometry type.
idStringRead-only: The id of the data source.
isBrokenBooleanRead-only: Indicates if the last query failed and the data source is in a broken state.
mapWidgetIdStringRead-only: The mapWidgetId of the data source.
nameStringRead-only: The name of the data source.
objectIdFieldNameStringRead-only: The name of the object id field.
supportsSelectionBooleanRead-only: Indicates if the data source supports selections.
typeIdFieldNameStringRead-only: The name of the type id field.
typesFeatureType[]Read-only: The collection of feature types.

Methods

NameReturn typeSummary
clearSelection()NoneClear the selection.
executeQuery(query)PromiseExecutes a query and get the result.
getAdvancedQueryCapabilities()PromiseAn object that contains service level metadata about whether or not the layer supports queries using statistics, order by fields, DISTINCT, pagination, query with distance, and returning queries with extents.
getAssociatedSelectionDataSourceId()PromiseRetrieve the associated id of the data source that supports selection.
getPopupInfo()PromiseGet the associated popupInfo for the data source if any available. See also, PopupTemplate.
getRenderer()PromiseGet the associated render object for the data source if any available.
getTypeFromFeature(feature)ObjectGet the feature type from a feature coming from the data source.
getValueFromFeature(feature, fieldName)Number | StringReturns the value corresponding to a field name from a feature coming from the data source.
selectFeatures(query)NoneSelect features in the data source using a query.
selectFeaturesByObjectIds(objectIds)NoneSelect features in the data source using a collection of object ids.
Property Details

<String> displayFieldName

Read-only: The name of the display field.

<Field[]> fields

Read-only: The collection of fields.

<String> geometryType

Read-only: The geometry type.

<String> id

Read-only: The id of the data source.

<Boolean> isBroken

Read-only: Indicates if the last query failed and the data source is in a broken state.
Default value: false

<String> mapWidgetId

Read-only: The mapWidgetId of the data source. (Added at v3.15)

<String> name

Read-only: The name of the data source.

<String> objectIdFieldName

Read-only: The name of the object id field.

<Boolean> supportsSelection

Read-only: Indicates if the data source supports selections.
Default value: false

<String> typeIdFieldName

Read-only: The name of the type id field.
Read-only: The collection of feature types.
Method Details

clearSelection()

Clear the selection. Only applicable if the data source is a selection data source, see supportsSelection.

executeQuery(query)

Executes a query and get the result.
Return type: Promise
Parameters:
<Query> query Required The query object to apply.

getAdvancedQueryCapabilities()

An object that contains service level metadata about whether or not the layer supports queries using statistics, order by fields, DISTINCT, pagination, query with distance, and returning queries with extents. (Added at v3.15)
Return type: Promise

getAssociatedSelectionDataSourceId()

Retrieve the associated id of the data source that supports selection. Note: Not all data sources have an associated selection data source id, the result could be null.
Return type: Promise

getPopupInfo()

Get the associated popupInfo for the data source if any available. See also, PopupTemplate.
Return type: Promise

getRenderer()

Get the associated render object for the data source if any available.
Return type: Promise

getTypeFromFeature(feature)

Get the feature type from a feature coming from the data source.
Return type: Object
Parameters:
<Graphic> feature Required A feature coming from the data source

getValueFromFeature(feature, fieldName)

Returns the value corresponding to a field name from a feature coming from the data source. Getting the user friendly value can be a complicated series of steps including checking for feature types and/or coded domains.
Return type: Number | String
Parameters:
<Graphic> feature Required A feature coming from the data source
<String> fieldName Required The name of the field for which the value should be returned.

selectFeatures(query)

Select features in the data source using a query. Only applicable if the data source is a selection data source, see supportsSelection.
Parameters:
<Query> query Required The query object to apply

selectFeaturesByObjectIds(objectIds)

Select features in the data source using a collection of object ids. Only applicable is the data source is a selection data source, see supportsSelection.
Parameters:
<Number[]> objectIds Required The collection of object ids of the features to select.
Show Modal