FeatureServiceDataSource

Interface

FeatureServiceDataSource is created from feature service.

Inheritance: FeatureServiceDataSourceDataSource

Properties

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.

addVersion optional
addVersion: () => void

Update data source version.

belongToDataSource optional
belongToDataSource: DataSource

The data source which this data source derives from.

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
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
fetchSchema: () => Promise<IMDataSourceSchema>

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

getAllDerivedDataSources
getAllDerivedDataSources: () => DataSource[]

Return the derived data views and local data sources.

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.

getCountStatus
getCountStatus: () => DataSourceStatus

Return data source count status.

getDataSourceJson
getDataSourceJson: () => IMDataSourceJson

The data source JSON object in app config.

getDataView
getDataView: (dataViewIdstring) => DataSource

Get data view by data view id.

getDataViews
getDataViews: () => DataSource[]

Return all data views created from a main data source.

getIdField
getIdField: () => string

Return the data source id field.

getInfo
getInfo: () => IMDataSourceInfo

Return the data source info in redux store.

getLabel
getLabel: () => string

Return data source label.

getListenSelection
getListenSelection: () => boolean

Return whether listen selection.

getLocalDataSource
getLocalDataSource: (localIdstring) => DataSource

Get local data source by local Id.

getLocalDataSources
getLocalDataSources: () => DataSource[]

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

getMainDataSource
getMainDataSource: () => DataSource

Return the main data source.

getRecord
getRecord: (indexnumber) => DataRecord

Get record by index

getRecordById
getRecordById: (idstring) => DataRecord

Get record by id

getRecords
getRecords: () => DataRecord[]

Get records

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.

getRootDataSource
getRootDataSource: () => DataSource

Return the root data source.

getSchema
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
getSourceRecords: () => DataRecord[]

Return the source records

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.

getStatus
getStatus: () => DataSourceStatus

Return data source status.

getVersion
getVersion: () => number

Return data source version.

id
id: string

The data source id.

isDataSourceSet
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
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
isLocal: boolean

True means the data source is a local data source.

localId optional
localId: string

The local id of the data source.

parentDataSource
parentDataSource: DataSource

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

ready
ready: () => Promise<any>

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

selectRecordById optional
selectRecordById: (idstring, record?DataRecord) => 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 optional
selectRecordsByIds: (idsstring[], records?DataRecord[]) => void

Select records by ids

setCountStatus optional
setCountStatus: (statusDataSourceStatus) => void

Update data source count status.

setDataSourceJson
setDataSourceJson: (dsJsonIMDataSourceJson) => void

Update data source JSON in data source instance

setListenSelection
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
setRecords: (recordsDataRecord[]) => void

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

setSourceRecords
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
type: FeatureService

The type of the data source

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