Select to view content in your preferred language

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

4187
12
Jump to solution
05-17-2019 10:18 AM
BrianVan_Nostrand
Regular Contributor

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
Regular Contributor

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
Frequent 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
Regular Contributor

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