Interface
The SubtypeGroupLayerDataSource
is created from a feature layer which contains subtype. It supports to query.
The source of the feature layer is same as FeatureLayerDataSource
.
Properties
Property | Type | 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. |
areChildDataSourcesCreated inherited | () => boolean | Return whether all child data sources (including descendant data sources) are created.
Data source has this method only if it is data source set ( |
belongToDataSource inherited | The data source which this data source derives from. | |
buildRecord inherited | (feature: IFeature | Graphic) => FeatureDataRecord | Builds a data record only -- does not add the record into data source. |
changeGDBVersion inherited | (gdbVersion: string) => void | Change the layer GDB version. |
childDataSourcesReady inherited | () => Promise<DataSource[]> | All child data sources (including descendant data sources) are ready for use.
Data source has this method only if it is data source set ( |
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. |
count inherited | number | The total records count depends on the current query |
createDataSourceById inherited | (dataSourceId: string) => Promise<DataSource> | Create a child or a descendant data source by id.
Data source has this method only if it is data source set ( |
createJSAPILayerByDataSource inherited | (dataSource?: DataSource, useDataSourceQueryParams?: boolean, throwError?: boolean) => Promise<Layer | ArcGISSubLayer> | Default |
dataSourceManager inherited | The data source manager, which is used to manage the data source, including create/get/destroy the data source instance. | |
dataViewId inherited | string | The data view ID configured in JSON. |
destroy inherited | () => void | Destroy the data source. |
fetchSchema inherited | () => Promise<IMDataSourceSchema> | Fetch the data schema from an actual data source. If it's a statistic data source, the schema will not be fetched. |
getAllChildDataSources inherited | () => DataSource[] | Return all child data sources of a parent data source, includes the grandchildren |
getAllDerivedDataSources inherited | () => DataSource[] | Return the derived data views and local data sources. |
getAllLoadedRecords inherited | () => DataRecord[] | Get records of all the loaded pages. |
getAutoRefreshInterval inherited | () => number | If the return value > 0, auto refresh is enabled. |
getChildDataSource inherited | (jimuChildId: string) => DataSource | Get child data source by |
getChildDataSources inherited | () => DataSource[] | Return child data sources of a parent data source. |
getCountStatus inherited | () => DataSourceStatus | Return data source count status. |
getCurrentQueryId inherited | () => string | Get the current loaded record id, which is used in |
getCurrentQueryParams inherited | (options?: GetCurrentQueryParamsOptions) => 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 inherited | () => ArcGISQueriableDataSource[] | Override parent interface to get correct type. |
getGDBVersion inherited | () => string | Return the current GDB version. |
getIdField inherited | () => 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 inherited | (localId: string) => 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 inherited | (pageSize: number, page: number) => number[] | Get real query page depends on the widget's request page. |
getRealQueryParams inherited | (query: any, flag: "query" | "load", options?: QueryOptions) => 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. |
getRecord inherited | (index: number) => DataRecord | Get record by index |
getRecordById inherited | (id: string) => DataRecord | Get record by ID |
getRecords inherited | () => DataRecord[] | 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 inherited | (page: number, pageSize: number) => DataRecord[] | 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 inherited | (page: number, pageSize: number) => DataRecord[] | 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 inherited | () => DataRecord[] | 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. |
getRootDataSource inherited | () => DataSource | Return the root data source. |
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 inherited | () => DataRecord[] | Get selected records |
getSelectionDataView inherited | () => DataSource | Get selection data view |
getSourceRecords inherited | () => DataRecord[] | 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. |
(id: string) => Promise<SubtypeSublayerDataSource> | Return the subtype sublayer data source by a record ID. If the sublayer data source is not created, it will create it. | |
getVersion inherited | () => number | Return data source version. |
id inherited | string | The data source ID. |
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 |
isDataView inherited | 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. |
isInAppConfig inherited | () => boolean | Return whether the data source is added in builder and is saved in app config. |
isLocal inherited | boolean | True means the data source is a local data source. |
isSqlCaseSensitive inherited | boolean | Whether the data source is case-sensitive when doing query by SQL clauses. |
load inherited | (query: ArcGISQueryParams, options?: QueryOptions) => Promise<DataRecord[]> | 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 |
loadById inherited | (id: string, refresh?: boolean) => Promise<DataRecord> | Load record by ID, do not consider other queries. |
loadCount inherited | (query: ArcGISQueryParams, options?: QueryOptions) => Promise<number> | Load the records count. |
localId inherited | string | The local ID of the data source. |
mergeQueryParams inherited | (queries: ArcGISQueryParams[]) => ArcGISQueryParams | Merge queries by using |
order inherited | number | Order in the parent data source. |
parentDataSource inherited | DataSource & SetDataSourceMixin | The parent data source of this data source, mull means it's a root data source. |
query inherited | (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 |
queryAll inherited | (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 |
queryById inherited | (id: string, fields?: string[]) => Promise<DataRecord> | Query record by ID.
Will return all fields if not pass in the |
queryCount inherited | (query: ArcGISQueryParams, options?: QueryOptions) => Promise<QueryResult> | Query count |
queryIds inherited | (query: ArcGISQueryParams, options?: QueryOptions) => 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 |
selectRecordById inherited | (id: string, record?: FeatureDataRecord) => 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. |
setCountStatus inherited | (status: DataSourceStatus) => void | Update data source count status. |
setDataSourceJson inherited | (dsJson: IMDataSourceJson) => void | Update data source JSON in data source instance |
setListenSelection inherited | (listen: boolean) => 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. |
setRecords inherited | (records: DataRecord[]) => void | Update the records in the data source object only, does not update the source data. |
setSourceFeatures inherited | (features: Graphic | GraphicProperties[], others?: Omit<FeatureLayerProperties, "fields" | "source" | "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 |
setSourceRecords inherited | (records: DataRecord[]) => void | When current data source is created from an array of records ( |
setStatus inherited | (status: DataSourceStatus) => void | Update data source status. |
SubtypeGroupLayer | The type of the data source. | |
updateQueryParams inherited | (query: QueryParams, widgetId: string) => void | Update the data source query without executing the actual query. |
updateSelectionInfo inherited | (options: SelectOptions, triggerDataSource: DataSource, forceCheck?: boolean) => void | Update selected records in data source info if the current data source listens selection change (see |
url inherited | string | The data source URL |
addSourceVersion
addSourceVersion: () => void
When 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.
Type declaration
function(): void
Returns
void
addVersion
addVersion: () => void
Update data source version.
Type declaration
function(): void
Returns
void
areChildDataSourcesCreated
areChildDataSourcesCreated: () => boolean
Return whether all child data sources (including descendant data sources) are created.
Data source has this method only if it is data source set ( dataSource.isDataSourceSet()
is true).
Type declaration
function(): boolean
Returns
boolean
belongToDataSource
belongToDataSource: DataSource
The data source which this data source derives from.
buildRecord
buildRecord: (feature: IFeature | Graphic) => FeatureDataRecord
Builds a data record only -- does not add the record into data source.
Type declaration
function(feature: IFeature | Graphic): FeatureDataRecord
Parameters
Parameter | Type |
---|---|
feature | IFeature | Graphic |
Returns
FeatureDataRecord
changeGDBVersion
changeGDBVersion: (gdbVersion: string) => void
Change the layer GDB version.
Type declaration
function(gdbVersion: string): void
Parameters
Parameter | Type |
---|---|
gdb | string |
Returns
void
childDataSourcesReady
childDataSourcesReady: () => Promise<DataSource[]>
All child data sources (including descendant data sources) are ready for use.
Data source has this method only if it is data source set ( dataSource.isDataSourceSet()
is true).
Type declaration
function(): Promise<DataSource[]>
Returns
Promise<DataSource[]>
clearRecords
clearRecords: () => 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.
Type declaration
function(): void
Returns
void
clearSourceRecords
clearSourceRecords: () => void
Clear both sourceRecords and loaded records. Both source version and version in data source info will be updated.
Type declaration
function(): void
Returns
void
count
count: number
The total records count depends on the current query
createDataSourceById
createDataSourceById: (dataSourceId: string) => Promise<DataSource>
Create a child or a descendant data source by id.
Data source has this method only if it is data source set ( dataSource.isDataSourceSet()
is true).
Please note will only create the specific data source, won't create descendant data sources of it.
Type declaration
function(dataSourceId: string): Promise<DataSource>
Parameters
Parameter | Type |
---|---|
data | string |
Returns
Promise<DataSource>
createJSAPILayerByDataSource
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.
Type declaration
function(dataSource?: DataSource, useDataSourceQueryParams?: boolean, throwError?: boolean): Promise<Layer | ArcGISSubLayer>
Parameters
Parameter | Type |
---|---|
data | DataSource |
use | boolean |
throw | boolean |
Returns
Promise<Layer | ArcGISSubLayer>
dataSourceManager
dataSourceManager: DataSourceManager
The data source manager, which is used to manage the data source, including create/get/destroy the data source instance.
dataViewId
dataViewId: string
The data view ID configured in JSON.
destroy
destroy: () => void
Destroy the data source.
Type declaration
function(): void
Returns
void
fetchSchema
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.
Type declaration
function(): Promise<IMDataSourceSchema>
Returns
Promise<IMDataSourceSchema>
getAllChildDataSources
getAllChildDataSources: () => DataSource[]
Return all child data sources of a parent data source, includes the grandchildren
Type declaration
function(): DataSource[]
Returns
DataSource[]
getAllDerivedDataSources
getAllDerivedDataSources: () => DataSource[]
Return the derived data views and local data sources.
Type declaration
function(): DataSource[]
Returns
DataSource[]
getAllLoadedRecords
getAllLoadedRecords: () => DataRecord[]
Get records of all the loaded pages.
Type declaration
function(): DataRecord[]
Returns
DataRecord[]
getAutoRefreshInterval
getAutoRefreshInterval: () => number
If the return value > 0, auto refresh is enabled.
Type declaration
function(): number
Returns
number
getChildDataSource
getChildDataSource: (jimuChildId: string) => DataSource
Get child data source by jimuChildId
. You can get jimuChildId
by getJimuChildId()
.
Type declaration
function(jimuChildId: string): DataSource
Parameters
Parameter | Type |
---|---|
jimu | string |
Returns
DataSource
getChildDataSources
getChildDataSources: () => DataSource[]
Return child data sources of a parent data source.
Type declaration
function(): DataSource[]
Returns
DataSource[]
getCountStatus
getCountStatus: () => DataSourceStatus
Return data source count status.
Type declaration
function(): DataSourceStatus
Returns
DataSourceStatus
getCurrentQueryId
getCurrentQueryId: () => string
Get the current loaded record id, which is used in loadById
method.
Type declaration
function(): string
Returns
string
getCurrentQueryParams
getCurrentQueryParams: (options?: GetCurrentQueryParamsOptions) => ArcGISQueryParams
Get the current query parameters. The current query parameters contain all applied queries.
Type declaration
function(options?: GetCurrentQueryParamsOptions): ArcGISQueryParams
Parameters
Parameter | Type |
---|---|
options | GetCurrentQueryParamsOptions |
Returns
ArcGISQueryParams
getDataSourceJson
getDataSourceJson: () => IMDataSourceJson
The data source JSON object in app config.
Type declaration
function(): IMDataSourceJson
Returns
IMDataSourceJson
getDataViewConfig
getDataViewConfig: () => IMDataViewJson
Return the config of the current data source.
Type declaration
function(): IMDataViewJson
Returns
IMDataViewJson
getDataViews
getDataViews: () => ArcGISQueriableDataSource[]
Override parent interface to get correct type.
Type declaration
function(): ArcGISQueriableDataSource[]
Returns
ArcGISQueriableDataSource[]
getGDBVersion
getGDBVersion: () => string
Return the current GDB version.
Type declaration
function(): string
Returns
string
getIdField
getIdField: () => string
Return the data source ID field.
Type declaration
function(): string
Returns
string
getInfo
getInfo: () => IMDataSourceInfo
Return the data source info in redux store.
Type declaration
function(): IMDataSourceInfo
Returns
IMDataSourceInfo
getLabel
getLabel: () => string
Return data source label.
Type declaration
function(): string
Returns
string
getListenSelection
getListenSelection: () => boolean
Return whether listen selection.
Type declaration
function(): boolean
Returns
boolean
getLocalDataSource
getLocalDataSource: (localId: string) => DataSource
Get local data source by local ID.
Type declaration
function(localId: string): DataSource
Parameters
Parameter | Type |
---|---|
local | string |
Returns
DataSource
getLocalDataSources
getLocalDataSources: () => DataSource[]
Return all local data sources created from a main data source or data view.
Type declaration
function(): DataSource[]
Returns
DataSource[]
getMaxRecordCount
getMaxRecordCount: () => number
Null means there is no record count limit, and will return all records from the service.
Type declaration
function(): number
Returns
number
getRealQueryPages
getRealQueryPages: (pageSize: number, page: number) => number[]
Get real query page depends on the widget's request page.
Type declaration
function(pageSize: number, page: number): number[]
Parameters
Parameter | Type |
---|---|
page | number |
page | number |
Returns
number[]
getRealQueryParams
getRealQueryParams: (query: any, flag: "query" | "load", options?: QueryOptions) => 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.
- 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.
Type declaration
function(query: any, flag: "query" | "load", options?: QueryOptions): ArcGISQueryParams
Parameters
Parameter | Type |
---|---|
query | any |
flag | "query" | "load" |
options | QueryOptions |
Returns
ArcGISQueryParams
getRecord
getRecord: (index: number) => DataRecord
Get record by index
Type declaration
function(index: number): DataRecord
Parameters
Parameter | Type |
---|---|
index | number |
Returns
DataRecord
getRecordById
getRecordById: (id: string) => DataRecord
Get record by ID
Type declaration
function(id: string): DataRecord
Parameters
Parameter | Type |
---|---|
id | string |
Returns
DataRecord
getRecords
getRecords: () => DataRecord[]
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.
Type declaration
function(): DataRecord[]
Returns
DataRecord[]
getRecordsByPage
getRecordsByPage: (page: number, pageSize: number) => DataRecord[]
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.
Type declaration
function(page: number, pageSize: number): DataRecord[]
Parameters
Parameter | Type |
---|---|
page | number |
page | number |
Returns
DataRecord[]
getRecordsByPageWithSelection
getRecordsByPageWithSelection: (page: number, pageSize: number) => DataRecord[]
If selected records are not loaded in the current data source, will concat them to the end of records array. See getRecordsWithSelection for details.
Type declaration
function(page: number, pageSize: number): DataRecord[]
Parameters
Parameter | Type |
---|---|
page | number |
page | number |
Returns
DataRecord[]
getRecordsWithSelection
getRecordsWithSelection: () => DataRecord[]
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.
Type declaration
function(): DataRecord[]
Returns
DataRecord[]
getRootDataSource
getRootDataSource: () => DataSource
Return the root data source.
Type declaration
function(): DataSource
Returns
DataSource
getSchema
getSchema: () => 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.
Type declaration
function(): IMDataSourceSchema
Returns
IMDataSourceSchema
getSelectedRecordIds
getSelectedRecordIds: () => string[]
Get selected record IDs
Type declaration
function(): string[]
Returns
string[]
getSelectedRecordIndexes
getSelectedRecordIndexes: () => number[]
Get selected record indexes
Type declaration
function(): number[]
Returns
number[]
getSelectedRecords
getSelectedRecords: () => DataRecord[]
Get selected records
Type declaration
function(): DataRecord[]
Returns
DataRecord[]
getSelectionDataView
getSelectionDataView: () => DataSource
Get selection data view
Type declaration
function(): DataSource
Returns
DataSource
getSourceRecords
getSourceRecords: () => DataRecord[]
Return the source records
Type declaration
function(): DataRecord[]
Returns
DataRecord[]
getSourceVersion
getSourceVersion: () => number
When current data source is created from an array of records, it will be saved in sourceRecords
.
Return the version of sourceRecords
.
Type declaration
function(): number
Returns
number
getStatus
getStatus: () => DataSourceStatus
Return data source status.
Type declaration
function(): DataSourceStatus
Returns
DataSourceStatus
getSublayerDataSourceByRecordId
Interface PropertygetSublayerDataSourceByRecordId: (id: string) => Promise<SubtypeSublayerDataSource>
Return the subtype sublayer data source by a record ID. If the sublayer data source is not created, it will create it.
Type declaration
function(id: string): Promise<SubtypeSublayerDataSource>
Parameters
Parameter | Type |
---|---|
id | string |
Returns
Promise<SubtypeSublayerDataSource>
getVersion
getVersion: () => number
Return data source version.
Type declaration
function(): number
Returns
number
isDataSourceSet
isDataSourceSet: () => thisisDataSource & SetDataSourceMixin
Whether 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
.
Type declaration
function(): thisisDataSource & SetDataSourceMixin
Returns
thisisDataSource & SetDataSourceMixin
isDataView
isDataView: 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.
isInAppConfig
isInAppConfig: () => boolean
Return whether the data source is added in builder and is saved in app config.
Type declaration
function(): boolean
Returns
boolean
isLocal
isLocal: boolean
True means the data source is a local data source.
isSqlCaseSensitive
isSqlCaseSensitive: boolean
Whether the data source is case-sensitive when doing query by SQL clauses.
load
load: (query: ArcGISQueryParams, options?: QueryOptions) => Promise<DataRecord[]>
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.
Type declaration
function(query: ArcGISQueryParams, options?: QueryOptions): Promise<DataRecord[]>
Parameters
Parameter | Type |
---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<DataRecord[]>
loadById
loadById: (id: string, refresh?: boolean) => Promise<DataRecord>
Load record by ID, do not consider other queries.
Type declaration
function(id: string, refresh?: boolean): Promise<DataRecord>
Parameters
Parameter | Type |
---|---|
id | string |
refresh | boolean |
Returns
Promise<DataRecord>
loadCount
loadCount: (query: ArcGISQueryParams, options?: QueryOptions) => Promise<number>
Load the records count.
Type declaration
function(query: ArcGISQueryParams, options?: QueryOptions): Promise<number>
Parameters
Parameter | Type |
---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<number>
mergeQueryParams
mergeQueryParams: (queries: ArcGISQueryParams[]) => ArcGISQueryParams
Merge queries by using AND
, and return the merged result.
If any query is undefined/null, it will be ignored.
Type declaration
function(queries: ArcGISQueryParams[]): ArcGISQueryParams
Parameters
Parameter | Type |
---|---|
queries | ArcGISQueryParams[] |
Returns
ArcGISQueryParams
parentDataSource
parentDataSource: DataSource & SetDataSourceMixin
The parent data source of this data source, mull means it's a root data source.
query
query: (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
.
Type declaration
function(query: ArcGISQueryParams, options?: QueryOptions): Promise<QueryResult>
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.
Type declaration
function(query: QueryParams, signal?: AbortSignal, progressCallback?: QueryProgressCallback, options?: QueryOptions): Promise<QueryResult>
Parameters
Parameter | Type |
---|---|
query | QueryParams |
signal | AbortSignal |
progress | QueryProgressCallback |
options | QueryOptions |
Returns
Promise<QueryResult>
queryById
queryById: (id: string, fields?: string[]) => Promise<DataRecord>
Query record by ID.
Will return all fields if not pass in the fields
.
Type declaration
function(id: string, fields?: string[]): Promise<DataRecord>
Parameters
Parameter | Type |
---|---|
id | string |
fields | string[] |
Returns
Promise<DataRecord>
queryCount
queryCount: (query: ArcGISQueryParams, options?: QueryOptions) => Promise<QueryResult>
Query count
Type declaration
function(query: ArcGISQueryParams, options?: QueryOptions): Promise<QueryResult>
Parameters
Parameter | Type |
---|---|
query | ArcGISQueryParams |
options | QueryOptions |
Returns
Promise<QueryResult>
queryIds
queryIds: (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.
Type declaration
function(query: ArcGISQueryParams, options?: QueryOptions): Promise<QueryResult>
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
.
Type declaration
function(): Promise<any>
Returns
Promise<any>
selectRecordById
selectRecordById: (id: string, record?: FeatureDataRecord) => 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.
Type declaration
function(id: string, record?: FeatureDataRecord): void
Parameters
Parameter | Type | Notes |
---|---|---|
id | string | The ID to be selected. The selection will be cleared if the ID is null. |
record | FeatureDataRecord |
Returns
void
setCountStatus
setCountStatus: (status: DataSourceStatus) => void
Update data source count status.
Type declaration
function(status: DataSourceStatus): void
Parameters
Parameter | Type |
---|---|
status | DataSourceStatus |
Returns
void
setDataSourceJson
setDataSourceJson: (dsJson: IMDataSourceJson) => void
Update data source JSON in data source instance
Type declaration
function(dsJson: IMDataSourceJson): void
Parameters
Parameter | Type |
---|---|
ds | IMDataSourceJson |
Returns
void
setListenSelection
setListenSelection: (listen: boolean) => 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.
Main data source and its data views will listen selected records by default, local data source does not listen selected records by default.
Type declaration
function(listen: boolean): void
Parameters
Parameter | Type |
---|---|
listen | boolean |
Returns
void
setRecords
setRecords: (records: DataRecord[]) => void
Update the records in the data source object only, does not update the source data.
Type declaration
function(records: DataRecord[]): void
Parameters
Parameter | Type |
---|---|
records | DataRecord[] |
Returns
void
setSourceFeatures
setSourceFeatures: (features: Graphic | GraphicProperties[], others?: Omit<FeatureLayerProperties, "fields" | "source" | "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.
Type declaration
function(features: Graphic | GraphicProperties[], others?: Omit<FeatureLayerProperties, "fields" | "source" | "objectIdField">): Promise<void>
Parameters
Parameter | Type |
---|---|
features | Graphic | GraphicProperties[] |
others | Omit<FeatureLayerProperties, "fields" | "source" | "objectIdField"> |
Returns
Promise<void>
setSourceRecords
setSourceRecords: (records: DataRecord[]) => void
When current data source is created from an array of records ( DataRecord
), 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.
Type declaration
function(records: DataRecord[]): void
Parameters
Parameter | Type |
---|---|
records | DataRecord[] |
Returns
void
setStatus
setStatus: (status: DataSourceStatus) => void
Update data source status.
Type declaration
function(status: DataSourceStatus): void
Parameters
Parameter | Type |
---|---|
status | DataSourceStatus |
Returns
void
updateQueryParams
updateQueryParams: (query: QueryParams, widgetId: string) => void
Update the data source query without executing the actual query.
Type declaration
function(query: QueryParams, widgetId: string): void
Parameters
Parameter | Type |
---|---|
query | QueryParams |
widget | string |
Returns
void
updateSelectionInfo
updateSelectionInfo: (options: SelectOptions, triggerDataSource: DataSource, forceCheck?: boolean) => void
Update 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.
Type declaration
function(options: SelectOptions, triggerDataSource: DataSource, forceCheck?: boolean): void
Parameters
Parameter | Type |
---|---|
options | SelectOptions |
trigger | DataSource |
force | boolean |
Returns
void