FeatureLayerDataSource is created from a single feature layer of feature service, map service or webmap/webscene.

Inheritance: FeatureLayerDataSourceQueriableDataSource


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.

addVersion optional
addVersion: () => void

Update data source version.

belongToDataSource optional
belongToDataSource: DataSource

The data source which this data source derives from.

changeGDBVersion: (gdbVersionstring) => void

Change the layer GDB version.

clearRecords optional
clearRecords: () => void

This function will clear the loaded records and won't clear the sourceRecords. Once the loaded records cleared, version in data source info will be updated.

clearSourceRecords: () => void

Clear both sourceRecords and loaded records. Both source version and version in data source info will be updated.

count optional
count: number

The total records count depends on the current query

dataViewId optional
dataViewId: string

The data view id configured in Json.

fetchSchema: () => Promise<IMDataSourceSchema>

Fetch data schema from an actual data source. If it's a statistic data source, we won't fetch schema.

getAllDerivedDataSources: () => DataSource[]

Return the derived data views and local data sources.

getAutoRefreshInterval: () => number

If the return value > 0, auto refresh is enabled.

getChildDataSource optional
getChildDataSource: (jimuChildIdstring) => DataSource

Get child data source by jimuChildId. You can get jimuChildId by getJimuChildId().

getChildDataSources optional
getChildDataSources: () => DataSource[]

Return child data sources of a parent data source.

getConfigQueryParams: () => FeatureLayerQueryParams

Get the user config query parameters.

getCountStatus: () => DataSourceStatus

Return data source count status.

getCurrentQueryParams: (excludeOption?WidgetDataSourcePair) => QueryParams

Get the current query parameters. The current query parameters contain all applied queries.

getDataSourceJson: () => IMDataSourceJson

The data source JSON object in app config.

getDataView: (dataViewIdstring) => QueriableDataSource

Get data view by data view id.

getDataViews: () => QueriableDataSource[]

Override parent interface to get correct type.

getGDBVersion: () => string

Return the current GDB version.

getGeometryType: () => GeometryType
getIdField: () => string

Return the data source id field.

getInfo: () => IMDataSourceInfo

Return the data source info in redux store.

getLabel: () => string

Return data source label.

getListenSelection: () => boolean

Return whether listen selection.

getLocalDataSource: (localIdstring) => DataSource

Get local data source by local Id.

getLocalDataSources: () => DataSource[]

Return all local data sources created from a main data source or data view.

getMainDataSource: () => QueriableDataSource

Return the main data source.

getMaxRecordCount: () => number

Null means there is no record count limit, and will return all records from the service.

getRealQueryPages: (pageSizenumber, pagenumber) => number[]

Get real query page depends on the widget's request page.

getRealQueryParams: (queryany, flag"query" | "load", options?QueryOptions) => FeatureLayerQueryParams

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.
getRecord: (indexnumber) => DataRecord

Get record by index

getRecordById: (idstring) => DataRecord

Get record by id

getRecords: () => DataRecord[]

Get records

getRecordsByPage: (pagenumber, pageSizenumber) => 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: (pagenumber, pageSizenumber) => 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: () => 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.

getRemoteQueryParams: () => QueryParams

Get the query parameters configured in remote (not in exb).

getRootDataSource: () => DataSource

Return the root data source.

getRuntimeQueryParams: (excludeWidgetId?string) => QueryParams

Get the queries applied in runtime. If the excludeWidgetId is passed in, the queries of this widget will be excluded.

getSchema: () => IMDataSourceSchema

The schema returned here is the merged result of the configured schema and the fetched schema.

getSelectedRecordIds optional
getSelectedRecordIds: () => string[]

Get selected record ids

getSelectedRecordIndexes optional
getSelectedRecordIndexes: () => number[]

Get selected record indexes

getSelectedRecords optional
getSelectedRecords: () => DataRecord[]

Get selected records

getSourceRecords: () => DataRecord[]

Return the source records

getSourceVersion: () => number

When current data source is created from an array of records, it will be saved in sourceRecords. Return the version of sourceRecords.

getStatus: () => DataSourceStatus

Return data source status.

getVersion: () => number

Return data source version.

id: string

The data source id.

isDataSourceSet: boolean

Whether a data source contains child data sources. A dataset data source should create all its child data sources before ready() is resolved.

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.

isLocal: boolean

True means the data source is a local data source.

layer optional
layer: FeatureLayer

The ArcGIS JS API FeatureLayer object.

load: (queryFeatureLayerQueryParams, 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 returnd 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.

loadById: (idstring, refresh?boolean) => Promise<DataRecord>

Load record by id, do not consider other queries.

loadCount: (queryFeatureLayerQueryParams, options?QueryOptions) => Promise<number>

Load the records count.

localId optional
localId: string

The local id of the data source.

mergeQueryParams: (baseQueryFeatureLayerQueryParams, newQueryFeatureLayerQueryParams) => FeatureLayerQueryParams

Merge the new query to base query by using AND, and return the merged result. If any query is undefined/null, it will be ignored.

parentDataSource: DataSource

The parent data source of this data source, mull means it's a root data source.

query: (queryPropertiesFeatureLayerQueryParams) => Promise<QueryResult>

Execute query against the service only, do NOT update the internal data records. The actural query parameters are generated by getRealQueryParams.

To query count, please use queryCount.

queryById: (idstring) => Promise<FeatureDataRecord>

Query record by id

queryCount: (queryPropertiesFeatureLayerQueryParams) => Promise<QueryResult>

Query count

ready: () => Promise<any>

Ready is resolved means the data source instance is ready for use.

selectRecordById: (idstring, record?FeatureDataRecord) => void

Select a record by id. When select record by id, we can pass in the records. So when the selected records are not in the data source, we can add it in.

selectRecordsByIds: (idsstring[], records?FeatureDataRecord[]) => void

Select records by ids

setCountStatus optional
setCountStatus: (statusDataSourceStatus) => void

Update data source count status.

setDataSourceJson: (dsJsonIMDataSourceJson) => void

Update data source JSON in data source instance

setListenSelection: (listenboolean) => 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. 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.

setRecords: (recordsDataRecord[]) => void

Update the records in the data source object only, does not update the source data. See DataSourceEditSourceOperations.updateRecords

setSourceRecords: (recordsDataRecord[]) => void

When current data source is created from an array of records, will save it in sourceRecords. These two methods are use to update or get the source data.

setStatus optional
setStatus: (statusDataSourceStatus) => void

Update data source status.

type: FeatureLayer

The type of the data source

updateQueryParams: (queryQueryParams, widgetIdstring) => void

Update the data source query without executing the actual query.

url: string

The data source URL

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.