DataSourceComponent with two or more Datasources

281
1
09-30-2022 01:00 AM
Zoggo
by
New Contributor III

Hi there

I'm developing a custom widget with a list which contains values from a feature class and a table mixed together for each row. The table and the feature class has a common id. Because the feature class und and table are branch are versioned I can't do a join in the FeatureService. So I have to join the feature class and table in the custom widet. Is there way to create a custom datasource which contains the joined data from the datasources defined in setting.tsx. An other ideas was to pass two datasources to the DataSourceComponent. Does any one has experiences with this?

0 Kudos
1 Reply
YueyangLi
New Contributor II

Hi @Zoggo ,

You can use MultipleDataSourceComponent or two DataSourceComponent. To use MultipleDataSourceComponent -

 

import { MultipleDataSourceComponent } from 'jimu-core'
...

<MultipleDataSourceComponent
  useDataSources={props.useDataSources}
  onDataSourceCreated={onDataSourceCreated} // (dss: { [dataSourceId: string]: DataSource }) => void
  onDataSourceInfoChange={onDataSourceInfoChange} // (infos: { [dataSourceId: string]: IMDataSourceInfo }) => void
  queries={getQueries(useDataSources)} // { [dataSourceId: string]: QueryParams }
  widgetId={props.widgetId}
/>

 

0 Kudos