Trying to add another datasource using DataSourceSelector in settings.tsx only change synchronized with the other one, as they both user
useDataSources={this.props.useDataSources}
How do I make it happen?
Solved! Go to Solution.
Hi,
I'm not sure if this is what you're asking, but the DataSourceSelector component has a isMultiple prop that, when set to true, will allow the user to configure multiple data sources. There's no way you are expected to know this since the DataSourceSelector component is not documented anywhere. I discovered this after ~3 days of hacking through work-arounds.
Cheers
Hi,
I'm not sure if this is what you're asking, but the DataSourceSelector component has a isMultiple prop that, when set to true, will allow the user to configure multiple data sources. There's no way you are expected to know this since the DataSourceSelector component is not documented anywhere. I discovered this after ~3 days of hacking through work-arounds.
Cheers
Thanks, that's really great. How in the world did you find that given that the documentation links are broken?
It seems like I have to use a separate DataSourceComponent for each DataSource configured in the settings page - is that correct?
Hah, I finally found someone's implementation of the component where they pass in a isMultiple prop, in code published on Stack Overflow. I don't have the link handy, though, sorry. But, you can also see ESRI's own implementation of it in the Experience Builder source code. For example, in ...\client\dist\widgets\common\text\src\setting\setting.tsx.
And, yes, I'm mapping over this.props.useDataSources and passing each "useDataSource" to a DataSourceComponent. This works for me, since I'm summarizing data from each data source, so I use the callback function to pass actual DataSource objects to a summary table. I'm not sure if this is "correct", but it seems to work. Hope this helps.
Cheers
Were you able to utilize this to use more than 2 data sources? Right now it is only letting me select 2.
Hello, would you be able to share any examples you have that show your usage of the isMultiple prop? I have been working through how to use it, though it seems to not work for me. I found this bit of documentation for it, https://developers.arcgis.com/experience-builder/storybook/?path=/story/components-jimu-ui-advanced-... , which shows it works. Though I have tried putting the isMultiple into the List Widget itself and nothing happens. Any recommendations?
Thanks
Yes it helped. And yes, I find the documentation being somewhat sparse, and in need for another go-around in the Google index carousel.