DataSourceComponentProps

Interface

The DataSourceComponent component props.

Properties

PropertyTypeNotes
ReactNode | DataRenderFunction

If one of your children component's render depends on data source, please use this render function. Otherwise, even if the data record in the data source is changed, your children will not be re-rendered unless you connect the data source info in the children owner component to re-render the owner component.

number

Increment forceRefreshVersion to force data source to load even if the query parameter does not change. Please note, all widgets using the data source will refresh, too.

Query parameters of queriable data source. The component does not execute a query without query property. To execute a query without adding new filter, please use an empty object: {}.

boolean

Whether query record count when query data records.

Data source used by widget.

string

Pass widgetId/localId if need to execute the query.

children

optional
Interface Property
children: ReactNode | DataRenderFunction

If one of your children component's render depends on data source, please use this render function. Otherwise, even if the data record in the data source is changed, your children will not be re-rendered unless you connect the data source info in the children owner component to re-render the owner component.

See here for the difference between parent and owner context: https://gist.github.com/jimfb/0eb6e61f300a8c1b2ce7.

forceRefreshVersion

optional
Interface Property
forceRefreshVersion: number

Increment forceRefreshVersion to force data source to load even if the query parameter does not change. Please note, all widgets using the data source will refresh, too.

query

optional
Interface Property
query: QueryParams

Query parameters of queriable data source. The component does not execute a query without query property. To execute a query without adding new filter, please use an empty object: {}.

queryCount

optional
Interface Property
queryCount: boolean

Whether query record count when query data records.

useDataSource

Interface Property
useDataSource: IMUseDataSource

Data source used by widget.

widgetId

optional
Interface Property
widgetId: string

Pass widgetId/localId if need to execute the query.

For main data source or data view, please use widgetId. For local data source, please use localId. The recommended localId is: widgetId + ???

Methods

MethodReturnsNotes
void

Failing to create data source will call the function.

void

If one data source is used by mutiple widgets, every widget will receive the onDataSourceCreated callback.

onDataSourceInfoChange(info, preInfo?)
void

Data source info changing will call the function.

onDataSourceSchemaChange(schema, prevSchema?)
void

If data source schema is changed, will call the function.

onDataSourceStatusChange(status, preStatus?)
void

When then data source status changes, this function will be called.

onQueryRequired(queryRequiredInfo, preQueryRequiredInfo?)
void

Widgets may not pass in query props to load records into data source instance. In this case, widgets still need to listen to data source changes to refresh themselves. This callback is triggered whenever the data source properties such as filters or gdbVersion change. For example, adding a filter to data source will trigger the callback and selecting a record won't.

onSelectionChange(selection, preSelection?)
void

Selected records change will call the function.

onCreateDataSourceFailed

optional
Interface Method
onCreateDataSourceFailed(errany): void

Failing to create data source will call the function.

Parameters
ParameterType
err
any
Returns 
void

onDataSourceCreated

optional
Interface Method
onDataSourceCreated(dsDataSource): void

If one data source is used by mutiple widgets, every widget will receive the onDataSourceCreated callback.

Parameters
ParameterType
ds
DataSource
Returns 
void

onDataSourceInfoChange

optional
Interface Method
onDataSourceInfoChange(infoIMDataSourceInfo, preInfo?IMDataSourceInfo): void

Data source info changing will call the function.

Parameters
ParameterType
info
IMDataSourceInfo
preInfo
IMDataSourceInfo
Returns 
void

onDataSourceSchemaChange

optional
Interface Method
onDataSourceSchemaChange(schemaIMDataSourceSchema, prevSchema?IMDataSourceSchema): void

If data source schema is changed, will call the function.

Parameters
ParameterType
schema
IMDataSourceSchema
prevSchema
IMDataSourceSchema
Returns 
void

onDataSourceStatusChange

optional
Interface Method
onDataSourceStatusChange(statusDataSourceStatus, preStatus?DataSourceStatus): void

When then data source status changes, this function will be called.

Parameters
ParameterType
status
DataSourceStatus
preStatus
DataSourceStatus
Returns 
void

onQueryRequired

optional
Interface Method
onQueryRequired(queryRequiredInfoQueryRequiredInfo, preQueryRequiredInfo?QueryRequiredInfo): void

Widgets may not pass in query props to load records into data source instance. In this case, widgets still need to listen to data source changes to refresh themselves. This callback is triggered whenever the data source properties such as filters or gdbVersion change. For example, adding a filter to data source will trigger the callback and selecting a record won't.

Please note this callback will be valid only when the query prop is not used.

Parameters
ParameterType
queryRequiredInfo
QueryRequiredInfo
preQueryRequiredInfo
QueryRequiredInfo
Returns 
void

onSelectionChange

optional
Interface Method
onSelectionChange(selectionImmutableArray<string>, preSelection?ImmutableArray<string>): void

Selected records change will call the function.

Parameters
ParameterType
selection
ImmutableArray<string>
preSelection
ImmutableArray<string>
Returns 
void

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