SceneServiceDataSource is created from scene service or webscene.

Inheritance: SceneServiceDataSourceDataSource


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

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: () => DataSourceStatus

Return data source count status.

getDataSourceJson: () => IMDataSourceJson

The data source JSON object in app config.

getDataView: (dataViewIdstring) => DataSource

Get data view by data view id.

getDataViews: () => DataSource[]

Return all data views created from a main data source.

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: () => DataSource

Return the main data source.

getRecord: (indexnumber) => DataRecord

Get record by index

getRecordById: (idstring) => DataRecord

Get record by id

getRecords: () => DataRecord[]

Get records

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: () => DataSource

Return the root data source.

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.

localId optional
localId: string

The local id of the data source.

parentDataSource: DataSource

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

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: (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: SceneService

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.