Has anyone made a custom widget to display related data from a feature selection?

3584
12
Jump to solution
05-17-2019 10:18 AM
BrianVan_Nostrand
New Contributor III

Hi all,

I'm trying to figure out how to put together a web appbuilder widget that will display a formatted table of related attributes from a selected feature. My customer doesn't like how the out of the box attribute table looks.

Has anyone ever tried something like this?

12 Replies
BrianVan_Nostrand
New Contributor III

Leo,

Thanks! I'm working on tweaking the code to use the schema of my services now. Do you have any tips on resources to figure out how to do this? How did you learn to make widgets?

Thanks again,

Brian

0 Kudos
LeoLiu1
Occasional Contributor

I normally play in the developer version before deploy to Portal.

The documents and samples there are very helpful.

https://developers.arcgis.com/web-appbuilder/guide/getstarted.htm

0 Kudos
BrianVan_Nostrand
New Contributor III

Leo,

Thanks a lot for your help last month. Using your code as a framework, I managed to put together a widget that our customer likes. For anyone reading this in the future that is getting hung up on accessing the attributes of a selected feature, look at the code Leo shared above, specifically:

showRelatedData: function(featureSet){
    var layerId = featureSet.features[0]._layer.id;
    this.selectedFeatureLayer = this.map._layers[layerId];

poke around in featureSet to find a list of the selected features and their attributes, and in this.map to find map properties, as they would appear in a ESRI JS API 3.28 map.

0 Kudos