I am struggling to figure out how to create a DataSource from a FeatureLayer that is created in a Widget.tsx.
I am not allowing the user to select a DataSource, I am creating a FeatureLayer in code and then adding it to the map. Now I want to open this FeatureLayer in the Table widget so I need a DataSource to pass.
Please take a look at this (on show code)
I think it might help.
I am facing the same problem for the same reasons. My widget creates a FeatureLayer and I would like this FeatureLayer to be viewed in the AttributeTable. I have no input datasource. Thanks for any suggestions.
Did you ever solve this? I've been trying to figure out how to do this as well. The documentation seems to imply this is possible/expected, but the documentation and examples aren't of much help.
Nope.
I agreed the documentation seems to imply that it is possible but it remained mystery for me. I tried to use their example in the Widget Development guide: "1.2 Use a widget's output data source" with a dummy input data source (to get the schema), but I still cannot figure how to load my own generated features.
So I came back to it and managed to get a solution with my dummy input source. I used the Esri example "1.2 Use a widget's output data source" for the setting.tsx file. Then in my widget.tsx file, I did not use the DataSourceComponent and just use the DataSourceManager to get an instance of my output datasource: