Interface
ArcGISQueriableDataSource is created from a single ArcGIS queriable layer, such as feature layer, imagery layer and subtype group layer.
Properties
| Property | Type | Notes |
|---|---|---|
belongToDataSourceinherited | DataSource | The data source which this data source derives from. |
countinherited | number | The total records count depends on the current query |
dataSourceManagerinherited | DataSourceManager | The data source manager, which is used to manage the data source, including create/get/destroy the data source instance. |
dataViewIdinherited | string | The data view ID configured in JSON. |
idinherited | string | The data source ID. |
isDataViewinherited | boolean | True means the data source is a data view. For local data source, this is false even the local data source is created from a data view. |
isLocalinherited | boolean | True means the data source is a local data source. |
isSqlCaseSensitiveinherited | boolean | Whether the data source is case-sensitive when doing query by SQL clauses. |
layer | ArcGISQueriableLayerTypes | 1 How to use ArcGIS Maps SDK for JavaScript layer
1.1 a data source may have a layer, the layer is the source of the data source ( |
localIdinherited | string | The local ID of the data source. |
orderinherited | number | Order in the parent data source. |
parentDataSourceinherited | DataSource & SetDataSourceMixin | The parent data source of this data source, mull means it's a root data source. |
typeinherited | string | The type of the data source. |
url | string | The data source URL |
belongToDataSource
belongToDataSource: DataSourceThe data source which this data source derives from.
count
count: numberThe total records count depends on the current query
dataSourceManager
dataSourceManager: DataSourceManagerThe data source manager, which is used to manage the data source, including create/get/destroy the data source instance.
isDataView
isDataView: booleanTrue means the data source is a data view. For local data source, this is false even the local data source is created from a data view.
isLocal
isLocal: booleanTrue means the data source is a local data source.
isSqlCaseSensitive
isSqlCaseSensitive: booleanWhether the data source is case-sensitive when doing query by SQL clauses.
layer
layer: ArcGISQueriableLayerTypes1 How to use ArcGIS Maps SDK for JavaScript layer
1.1 a data source may have a layer, the layer is the source of the data source ( isDataInDataSourceInstance should be false) and is used to save source data and communicate with Maps SDK for JavaScript (get popupTemplate, symbol and so on), if want to query features, should use data source instance, not the layer.
1.2 main data source and all other data views/local data source share the same layer.
1.3 selection view create a new layer when do query, but doesn't save the layer.
1.4 if widget needs an ArcGIS Maps SDK for JavaScript layer, call dataSource.createJSAPILayerByDataSource() to create a new layer, do not use the layer in data source instance directly, to listen data source changes and apply the changes to the new layer, see 2.2.
2 How to listen data source changes via DataSourceComponent
2.1 if widget loads records, use onDataSourceInfoChange to listen selected records change, query params change and loaded records change.
2.2 if widget doesn't load records (use a Maps SDK for JavaScript widget and needs an ArcGIS Maps SDK for JavaScript layer), use onQueryRequired to listen query params change, use onSelectionChange to listen selected records change.
3 Relation between output data source and origin data source
3.1 if schema is not changed (e.g. query output) and only has one origin data source, will use origin data source's layerDefinition , popupInfo and Maps SDK for JavaScript layer .
3.2 if schema is changed (e.g. chart output), need widget to set layerDefinition , popupInfo and Maps SDK for JavaScript layer to data source instance.
parentDataSource
parentDataSource: DataSource & SetDataSourceMixinThe parent data source of this data source, mull means it's a root data source.
Methods
| Method | Returns | Notes |
|---|---|---|
addSourceVersion()inherited | void | When current data source is created from an array of records, it will be saved in |
addVersion()inherited | void | Update data source version. |
buildRecord(feature) | FeatureDataRecord | Builds a data record only -- does not add the record into data source. |
changeGDBVersion(gdbVersion) | void | Change the layer GDB version. |
clearRecords()inherited | void | This function will clear the loaded records and won't clear the sourceRecords. Once the loaded records are cleared, the version in the data source info will be updated. |
clearSourceRecords()inherited | void | Clear both sourceRecords and loaded records. Both source version and version in data source info will be updated. |
createJSAPILayerByDataSource(dataSource?, useDataSourceQueryParams?, throwError?)inherited | Promise<Layer | ArcGISSubLayer> | Default |
destroy()inherited | void | Destroy the data source. |
fetchSchema() | Promise<IMDataSourceSchema> | Fetch the data schema from an actual data source. If it's a statistic data source, the schema will not be fetched. |
getAllDerivedDataSources()inherited | DataSource[] | Return the derived data views and local data sources. |
getAllLoadedRecords() | FeatureDataRecord[] | Get records of all the loaded pages. |
getAutoRefreshInterval()inherited | number | If the return value > 0, auto refresh is enabled. |
getConfigQueryParams() | ArcGISQueryParams | Get the user config query parameters. |
getCountStatus()inherited | DataSourceStatus | Return data source count status. |
getCurrentQueryId()inherited | string | Get the current loaded record id, which is used in |
getCurrentQueryParams(options?) | ArcGISQueryParams | Get the current query parameters. The current query parameters contain all applied queries. |
getDataSourceJson()inherited | IMDataSourceJson | The data source JSON object in app config. |
getDataViewConfig()inherited | IMDataViewJson | Return the config of the current data source. |
getDataViews() | ArcGISQueriableDataSource[] | Override parent interface to get correct type. |
getGDBVersion() | string | Return the current GDB version. |
getIdField() | string | Return the data source ID field. |
getInfo()inherited | IMDataSourceInfo | Return the data source info in redux store. |
getLabel()inherited | string | Return data source label. |
getListenSelection()inherited | boolean | Return whether listen selection. |
getLocalDataSource(localId)inherited | DataSource | Get local data source by local ID. |
getLocalDataSources()inherited | DataSource[] | Return all local data sources created from a main data source or data view. |
getMaxRecordCount()inherited | number | Null means there is no record count limit, and will return all records from the service. |
getRealQueryPages(pageSize, page)inherited | number[] | Get real query page depends on the widget's request page. |
getRealQueryParams(query, flag, options?) | ArcGISQueryParams | When do query/load, we do not fire the query request directly. Instead, we'll consider the data source's config/current query parameter. |
getRecordById(id) | FeatureDataRecord | Get record by ID |
getRecords() | FeatureDataRecord[] | Get records of the loaded continuous pages. If the loaded pages are 1, 2, and 10, will only return records on the page 1 and 2. |
getRecordsByPage(page, pageSize) | FeatureDataRecord[] | The page size here defines the records this method returns, which are not the actual query pageSize. Will use a fixed pageSize to query and cache data. |
getRecordsByPageWithSelection(page, pageSize) | FeatureDataRecord[] | If selected records are not loaded in the current data source, will concat them to the end of records array. See getRecordsWithSelection for details. |
getRecordsWithSelection() | FeatureDataRecord[] | If selected records are not loaded in the current data source, they will be concatenated to the end of records array. For example, record 1 is selected in data view 1 and it is not loaded in data view 2 (record 1 actually matches query params of data view 2), dataView2.getRecordsWithSelection() will return all loaded records in data view 2 and record 1. |
getRemoteQueryParams()inherited | QueryParams | Get the query parameters configured in remote (not in exb). |
getRootDataSource()inherited | DataSource | Return the root data source. |
getRuntimeQueryParams(excludeWidgetId?)inherited | QueryParams | Get the queries applied in runtime. If the excludeWidgetId is passed in, the queries of this widget will be excluded. |
getSchema()inherited | IMDataSourceSchema | The schema returned here is the merged result of the configured schema and the fetched schema. The configured schema is the user's changes, such as a new data source name. The fetched schema is the original schema from AGOL/portal item or a remote database, such as the service name, the fields and the filters. |
getSelectedRecordIds()inherited | string[] | Get selected record IDs |
getSelectedRecordIndexes()inherited | number[] | Get selected record indexes |
getSelectedRecords() | FeatureDataRecord[] | Get selected records |
getSelectionDataView()inherited | DataSource | Get selection data view |
getSourceRecords() | FeatureDataRecord[] | Return the source records |
getSourceVersion()inherited | number | When current data source is created from an array of records, it will be saved in |
getStatus()inherited | DataSourceStatus | Return data source status. |
getVersion()inherited | number | Return data source version. |
isDataSourceSet()inherited | thisisDataSource & SetDataSourceMixin | Whether a data source contains child data sources.
A set data source won't create all its child data sources when |
isInAppConfig()inherited | boolean | Return whether the data source is added in builder and is saved in app config. |
isSelectionView()inherited | boolean | Determine whether the data source is a selection view. |
load(query, options?) | Promise<FeatureDataRecord[]> | Execute the query against the service and update the internal data records, pagination is supported.
When call this method, the real query is returned by |
loadAll(query, signal?, progressCallback?, options?) | Promise<FeatureDataRecord[]> | Load all records, there is no limit to the number of the records returned in the |
loadById(id, refresh?) | Promise<FeatureDataRecord> | Load record by ID, do not consider other queries. |
loadCount(query, options?) | Promise<number> | Load the records count. |
mergeQueryParams(queries) | ArcGISQueryParams | Merge queries by using |
query(query, options?) | Promise<QueryResult> | Execute query against the service only, do NOT update the internal data records.
The actual query parameters are generated by |
queryAll(query, signal?, progressCallback?, options?)inherited | Promise<QueryResult> | Query all records, there is no limit to the number of the records returned in the |
queryById(id, fields?) | Promise<FeatureDataRecord> | Query record by ID.
Will return all fields if not pass in the |
queryCount(query, options?) | Promise<QueryResult> | Query count |
queryIds(query, options?) | Promise<QueryResult> | Query record IDs, there is no limit to the number of the IDs returned in the |
ready()inherited | Promise<any> | Ready is resolved means the data source instance is ready for use.
Please note that can not make sure all child data sources are created if a set data source is ready.
To make sure all child data sources are created, please use |
selectAllLoadedRecords()inherited | void | Select all loaded records. |
selectRecordById(id, record?) | void | Select a record by ID. When select record by ID, we can pass in the record. So when the selected record is not loaded, we can add it in. |
selectRecordsByIds(ids, records?) | void | Select records by IDs. When select records by IDs, we can pass in the records. So when the selected records are not loaded, we can add them in. |
setCountStatus(status)inherited | void | Update data source count status. |
setDataSourceJson(dsJson)inherited | void | Update data source JSON in data source instance |
setListenSelection(listen)inherited | void | Whether listen selected records from other data sources which are derived from the same main data source. If true, will update selected record IDs of current data source info when selecting records via other derived data sources. Will also update selected record IDs when selecting records via current data source itself. If false, won't change selected record IDs when selecting records via other derived data sources. Will update selected record IDs only when selecting records via current data source itself. |
setNeedRefresh(needRefresh)inherited | void | When the auto refresh is turned on, and the data source needRefresh status is changed, this method will be invoked. |
setRecords(records) | void | Update the records in the data source object only, does not update the source data. |
setSourceFeatures(features, others?) | Promise<void> | When current data source is created from an array of features (__esri.Graphic), will save it in an ArcGIS Maps SDK for JavaScript feature layer.
This method is used to update the source data.
Please note, use this method only when |
setSourceRecords(records) | void | When current data source is created from an array of records ( |
setStatus(status)inherited | void | Update data source status. |
supportReplica() | Promise<boolean> | Whether supports to create replica. See https://developers.arcgis.com/rest/services-reference/enterprise/create-replica/. |
updateQueryParams(query, widgetId) | void | Update the data source query without executing the actual query. |
updateSelectionInfo(options, triggerDataSource, forceCheck?)inherited | void | Update selected records in data source info if the current data source listens selection change (see |
addSourceVersion
addSourceVersion(): voidWhen current data source is created from an array of records, it will be saved in sourceRecords .
Add the version of sourceRecords .
setSourceRecords will add the version by default.
Returns
voidaddVersion
addVersion(): voidUpdate data source version.
Returns
voidbuildRecord
Interface MethodbuildRecord(feature: IFeature | Graphic): FeatureDataRecordBuilds a data record only -- does not add the record into data source.
Parameters
| Parameter | Type |
|---|---|
feature | IFeature | Graphic |
Returns
FeatureDataRecordchangeGDBVersion
Interface MethodchangeGDBVersion(gdbVersion: string): voidChange the layer GDB version.
Parameters
| Parameter | Type |
|---|---|
gdb | string |
Returns
voidclearRecords
clearRecords(): voidThis function will clear the loaded records and won't clear the sourceRecords. Once the loaded records are cleared, the version in the data source info will be updated.
Returns
voidclearSourceRecords
clearSourceRecords(): voidClear both sourceRecords and loaded records. Both source version and version in data source info will be updated.
Returns
voidcreateJSAPILayerByDataSource
createJSAPILayerByDataSource(dataSource?: DataSource, useDataSourceQueryParams?: boolean, throwError?: boolean): Promise<Layer | ArcGISSubLayer>Default dataSource is the current data source.
Default useDataSourceQueryParams is true, that is to say apply the data source's query params to the created ArcGIS Maps SDK for JavaScript layer by default.
Default throwError is false, that is to say the method won't throw error and will return undefined if the creation fail.
Parameters
| Parameter | Type |
|---|---|
data | DataSource |
use | boolean |
throw | boolean |
Returns
Promise<Layer | ArcGISSubLayer>fetchSchema
Interface MethodfetchSchema(): Promise<IMDataSourceSchema>Fetch the data schema from an actual data source. If it's a statistic data source, the schema will not be fetched.
Returns
Promise<IMDataSourceSchema>getAllDerivedDataSources
getAllDerivedDataSources(): DataSource[]Return the derived data views and local data sources.
Returns
DataSource[]getAllLoadedRecords
Interface MethodgetAllLoadedRecords(): FeatureDataRecord[]Get records of all the loaded pages.
Returns
FeatureDataRecord[]getAutoRefreshInterval
getAutoRefreshInterval(): numberIf the return value > 0, auto refresh is enabled.
Returns
numbergetConfigQueryParams
Interface MethodgetConfigQueryParams(): ArcGISQueryParamsGet the user config query parameters.
Returns
ArcGISQueryParamsgetCountStatus
getCountStatus(): DataSourceStatusReturn data source count status.
Returns
DataSourceStatusgetCurrentQueryId
getCurrentQueryId(): stringGet the current loaded record id, which is used in loadById method.
Returns
stringgetCurrentQueryParams
Interface MethodgetCurrentQueryParams(options?: GetCurrentQueryParamsOptions): ArcGISQueryParamsGet the current query parameters. The current query parameters contain all applied queries.
Parameters
| Parameter | Type |
|---|---|
options | GetCurrentQueryParamsOptions |
Returns
ArcGISQueryParamsgetDataSourceJson
getDataSourceJson(): IMDataSourceJsonThe data source JSON object in app config.
Returns
IMDataSourceJsongetDataViewConfig
getDataViewConfig(): IMDataViewJsonReturn the config of the current data source.
Returns
IMDataViewJsongetDataViews
Interface MethodgetDataViews(): ArcGISQueriableDataSource[]Override parent interface to get correct type.
Returns
ArcGISQueriableDataSource[]getInfo
getInfo(): IMDataSourceInfoReturn the data source info in redux store.
Returns
IMDataSourceInfogetListenSelection
getListenSelection(): booleanReturn whether listen selection.
Returns
booleangetLocalDataSource
getLocalDataSource(localId: string): DataSourceGet local data source by local ID.
Parameters
| Parameter | Type |
|---|---|
local | string |
Returns
DataSourcegetLocalDataSources
getLocalDataSources(): DataSource[]Return all local data sources created from a main data source or data view.
Returns
DataSource[]getMaxRecordCount
getMaxRecordCount(): numberNull means there is no record count limit, and will return all records from the service.
Returns
numbergetRealQueryPages
getRealQueryPages(pageSize: number, page: number): number[]Get real query page depends on the widget's request page.
Parameters
| Parameter | Type |
|---|---|
page | number |
page | number |
Returns
number[]getRealQueryParams
Interface MethodgetRealQueryParams(query: any, flag: "load" | "query", options?: QueryOptions): ArcGISQueryParamsWhen do query/load, we do not fire the query request directly. Instead, we'll consider the data source's config/current query parameter.
- For load: we'll merge the configured query parameter if it has, and all widget applied queries.
- For query, we'll merge the current query parameter and the configured query parameter it has.
Parameters
| Parameter | Type |
|---|---|
query | any |
flag | "load" | "query" |
options | QueryOptions |
Returns
ArcGISQueryParamsgetRecordById
Interface MethodgetRecordById(id: string): FeatureDataRecordGet record by ID
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
FeatureDataRecordgetRecords
Interface MethodgetRecords(): FeatureDataRecord[]Get records of the loaded continuous pages. If the loaded pages are 1, 2, and 10, will only return records on the page 1 and 2.
Widgets can use different page sizes to query the data source, but the data source has a specific page size to query the service. The data source will save the loaded records by its own page size and split them when widgets doing queries (with different page and page sizes). The method returns continuous page records to make sure the order of the records is correct.
Returns
FeatureDataRecord[]getRecordsByPage
Interface MethodgetRecordsByPage(page: number, pageSize: number): FeatureDataRecord[]The page size here defines the records this method returns, which are not the actual query pageSize. Will use a fixed pageSize to query and cache data.
Parameters
| Parameter | Type |
|---|---|
page | number |
page | number |
Returns
FeatureDataRecord[]getRecordsByPageWithSelection
Interface MethodgetRecordsByPageWithSelection(page: number, pageSize: number): FeatureDataRecord[]If selected records are not loaded in the current data source, will concat them to the end of records array. See getRecordsWithSelection for details.
Parameters
| Parameter | Type |
|---|---|
page | number |
page | number |
Returns
FeatureDataRecord[]getRecordsWithSelection
Interface MethodgetRecordsWithSelection(): FeatureDataRecord[]If selected records are not loaded in the current data source, they will be concatenated to the end of records array. For example, record 1 is selected in data view 1 and it is not loaded in data view 2 (record 1 actually matches query params of data view 2), dataView2.getRecordsWithSelection() will return all loaded records in data view 2 and record 1.
Returns
FeatureDataRecord[]getRemoteQueryParams
getRemoteQueryParams(): QueryParamsGet the query parameters configured in remote (not in exb).
Returns
QueryParamsgetRootDataSource
getRootDataSource(): DataSourceReturn the root data source.
Returns
DataSourcegetRuntimeQueryParams
getRuntimeQueryParams(excludeWidgetId?: string): QueryParamsGet the queries applied in runtime. If the excludeWidgetId is passed in, the queries of this widget will be excluded.
Parameters
| Parameter | Type |
|---|---|
exclude | string |
Returns
QueryParamsgetSchema
getSchema(): IMDataSourceSchemaThe schema returned here is the merged result of the configured schema and the fetched schema. The configured schema is the user's changes, such as a new data source name. The fetched schema is the original schema from AGOL/portal item or a remote database, such as the service name, the fields and the filters.
Returns
IMDataSourceSchemagetSelectedRecordIds
getSelectedRecordIds(): string[]Get selected record IDs
Returns
string[]getSelectedRecordIndexes
getSelectedRecordIndexes(): number[]Get selected record indexes
Returns
number[]getSelectedRecords
Interface MethodgetSelectedRecords(): FeatureDataRecord[]Get selected records
Returns
FeatureDataRecord[]getSelectionDataView
getSelectionDataView(): DataSourceGet selection data view
Returns
DataSourcegetSourceRecords
Interface MethodgetSourceRecords(): FeatureDataRecord[]Return the source records
Returns
FeatureDataRecord[]getSourceVersion
getSourceVersion(): numberWhen current data source is created from an array of records, it will be saved in sourceRecords .
Return the version of sourceRecords .
Returns
numbergetStatus
getStatus(): DataSourceStatusReturn data source status.
Returns
DataSourceStatusgetVersion
getVersion(): numberReturn data source version.
Returns
numberisDataSourceSet
isDataSourceSet(): thisisDataSource & SetDataSourceMixinWhether a data source contains child data sources.
A set data source won't create all its child data sources when ready is resolved.
To make sure all child data sources are created, please use childDataSourcesReady .
Returns
thisisDataSource & SetDataSourceMixinisInAppConfig
isInAppConfig(): booleanReturn whether the data source is added in builder and is saved in app config.
Returns
booleanisSelectionView
isSelectionView(): booleanDetermine whether the data source is a selection view.
Returns
booleanload
Interface Methodload(query: ArcGISQueryParams, options?: QueryOptions): Promise<FeatureDataRecord[]>Execute the query against the service and update the internal data records, pagination is supported.
When call this method, the real query is returned by getRealQueryParams .
Pagination: The pagination properties in the passed in query parameter may be not the same as the real query pagination that is sent to the service. The real query pagination is defined in the data source setting.
Parameters
| Parameter | Type |
|---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<FeatureDataRecord[]>loadAll
Interface MethodloadAll(query: ArcGISQueryParams, signal?: AbortSignal, progressCallback?: QueryProgressCallback, options?: QueryOptions): Promise<FeatureDataRecord[]>Load all records, there is no limit to the number of the records returned in the records array response.
You can abort the progress by a abort signal and can use progressCallback to get the progress and the current results.
Parameters
| Parameter | Type |
|---|---|
query | ArcGISQueryParams |
signal | AbortSignal |
progress | QueryProgressCallback |
options | QueryOptions |
Returns
Promise<FeatureDataRecord[]>loadById
Interface MethodloadById(id: string, refresh?: boolean): Promise<FeatureDataRecord>Load record by ID, do not consider other queries.
Parameters
| Parameter | Type |
|---|---|
id | string |
refresh | boolean |
Returns
Promise<FeatureDataRecord>loadCount
Interface MethodloadCount(query: ArcGISQueryParams, options?: QueryOptions): Promise<number>Load the records count.
Parameters
| Parameter | Type |
|---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<number>mergeQueryParams
Interface MethodmergeQueryParams(queries: ArcGISQueryParams[]): ArcGISQueryParamsMerge queries by using AND , and return the merged result.
If any query is undefined/null, it will be ignored.
Parameters
| Parameter | Type |
|---|---|
queries | ArcGISQueryParams[] |
Returns
ArcGISQueryParamsquery
Interface Methodquery(query: ArcGISQueryParams, options?: QueryOptions): Promise<QueryResult>Execute query against the service only, do NOT update the internal data records.
The actual query parameters are generated by getRealQueryParams .
To query count, please use queryCount .
Parameters
| Parameter | Type |
|---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<QueryResult>queryAll
queryAll(query: QueryParams, signal?: AbortSignal, progressCallback?: QueryProgressCallback, options?: QueryOptions): Promise<QueryResult>Query all records, there is no limit to the number of the records returned in the records array response.
You can abort the progress by a abort signal and can use progressCallback to get the progress and the current results.
Parameters
| Parameter | Type |
|---|---|
query | QueryParams |
signal | AbortSignal |
progress | QueryProgressCallback |
options | QueryOptions |
Returns
Promise<QueryResult>queryById
Interface MethodqueryById(id: string, fields?: string[]): Promise<FeatureDataRecord>Query record by ID.
Will return all fields if not pass in the fields .
Parameters
| Parameter | Type |
|---|---|
id | string |
fields | string[] |
Returns
Promise<FeatureDataRecord>queryCount
Interface MethodqueryCount(query: ArcGISQueryParams, options?: QueryOptions): Promise<QueryResult>Query count
Parameters
| Parameter | Type |
|---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<QueryResult>queryIds
Interface MethodqueryIds(query: ArcGISQueryParams, options?: QueryOptions): Promise<QueryResult>Query record IDs, there is no limit to the number of the IDs returned in the ids array response.
Parameters
| Parameter | Type |
|---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<QueryResult>ready
ready(): Promise<any>Ready is resolved means the data source instance is ready for use.
Please note that can not make sure all child data sources are created if a set data source is ready.
To make sure all child data sources are created, please use childDataSourcesReady .
Returns
Promise<any>selectAllLoadedRecords
selectAllLoadedRecords(): voidSelect all loaded records.
Returns
voidselectRecordById
Interface MethodselectRecordById(id: string, record?: FeatureDataRecord): voidSelect a record by ID. When select record by ID, we can pass in the record. So when the selected record is not loaded, we can add it in.
Parameters
| Parameter | Type | Notes |
|---|---|---|
id | string | The ID to be selected. The selection will be cleared if the ID is null. |
record | FeatureDataRecord |
Returns
voidselectRecordsByIds
Interface MethodselectRecordsByIds(ids: string[], records?: FeatureDataRecord[]): voidSelect records by IDs. When select records by IDs, we can pass in the records. So when the selected records are not loaded, we can add them in.
Parameters
| Parameter | Type | Notes |
|---|---|---|
ids | string[] | The IDs to be selected. The selection will be cleared if the IDs are null. |
records | FeatureDataRecord[] |
Returns
voidsetCountStatus
setCountStatus(status: DataSourceStatus): voidUpdate data source count status.
Parameters
| Parameter | Type |
|---|---|
status | DataSourceStatus |
Returns
voidsetDataSourceJson
setDataSourceJson(dsJson: IMDataSourceJson): voidUpdate data source JSON in data source instance
Parameters
| Parameter | Type |
|---|---|
ds | IMDataSourceJson |
Returns
voidsetListenSelection
setListenSelection(listen: boolean): voidWhether listen selected records from other data sources which are derived from the same main data source. If true, will update selected record IDs of current data source info when selecting records via other derived data sources. Will also update selected record IDs when selecting records via current data source itself. If false, won't change selected record IDs when selecting records via other derived data sources. Will update selected record IDs only when selecting records via current data source itself.
Main data source and its data views will listen selected records by default, local data source does not listen selected records by default.
Parameters
| Parameter | Type |
|---|---|
listen | boolean |
Returns
voidsetNeedRefresh
setNeedRefresh(needRefresh: boolean): voidWhen the auto refresh is turned on, and the data source needRefresh status is changed, this method will be invoked.
Parameters
| Parameter | Type |
|---|---|
need | boolean |
Returns
voidsetRecords
Interface MethodsetRecords(records: FeatureDataRecord[]): voidUpdate the records in the data source object only, does not update the source data.
Parameters
| Parameter | Type |
|---|---|
records | FeatureDataRecord[] |
Returns
voidsetSourceFeatures
Interface MethodsetSourceFeatures(features: Graphic | GraphicProperties[], others?: Omit<__esri.FeatureLayerProperties, "source" | "fields" | "objectIdField">): Promise<void>When current data source is created from an array of features (__esri.Graphic), will save it in an ArcGIS Maps SDK for JavaScript feature layer.
This method is used to update the source data.
Please note, use this method only when isDataInDataSourceInstance is not true.
Parameters
| Parameter | Type |
|---|---|
features | Graphic | GraphicProperties[] |
others | Omit<__esri.FeatureLayerProperties, "source" | "fields" | "objectIdField"> |
Returns
Promise<void>setSourceRecords
Interface MethodsetSourceRecords(records: FeatureDataRecord[]): voidWhen current data source is created from an array of records ( FeatureDataRecord ), will save it in sourceRecords .
These two methods are used to update or get the source data.
Please note, use these two methods only when isDataInDataSourceInstance is true.
Parameters
| Parameter | Type |
|---|---|
records | FeatureDataRecord[] |
Returns
voidsetStatus
setStatus(status: DataSourceStatus): voidUpdate data source status.
Parameters
| Parameter | Type |
|---|---|
status | DataSourceStatus |
Returns
voidsupportReplica
Interface MethodsupportReplica(): Promise<boolean>Whether supports to create replica. See https://developers.arcgis.com/rest/services-reference/enterprise/create-replica/.
Returns
Promise<boolean>updateQueryParams
Interface MethodupdateQueryParams(query: ArcGISQueryParams, widgetId: string): voidUpdate the data source query without executing the actual query.
Parameters
| Parameter | Type |
|---|---|
query | ArcGISQueryParams |
widget | string |
Returns
voidupdateSelectionInfo
updateSelectionInfo(options: SelectOptions, triggerDataSource: DataSource, forceCheck?: boolean): voidUpdate selected records in data source info if the current data source listens selection change (see setListenSelection ) or the current data source is the trigger data source (that is to say, select via it).
Before update info, will check whether these selected records match filters of the current data source firstly, and then only set the matched selected records to info.
Will skip the check in some cases to improve performance if the forceCheck is not passed in or is false. For example, if the current data source is main data source (we suppose that main data source contains all records, no need to check).
But if the forceCheck is true, won't skip the check.
Parameters
| Parameter | Type |
|---|---|
options | SelectOptions |
trigger | DataSource |
force | boolean |
Returns
void