Display custom widget's query results in Attribute Table widget

3069
4
06-11-2015 03:22 PM
BingLu
by
New Contributor II

I have a custom widget that queries some layers. When the query results are back, is there any way to send the results to the Attribute Table Widget to display? Thanks!

0 Kudos
4 Replies
PrevinWong1
Esri Contributor

You could make your query result a feature layer and then add it to the map.  Then in the layer list, right click the resulting query layer and go show attribute table.

0 Kudos
BingLu
by
New Contributor II

Thanks Previn! This approach seemed to work well initially. When I use the query results to create a feature layer and add it to the map, the Attribute Table widget does display the results in the first tab. However, if I add more feature layers later on, none of them shows up in the Attribute Table widget. I can see those new layer IDs in map.graphicLayerIds, though. Do you happen to know why it does that? Thanks!

PrevinWong1
Esri Contributor

Bing,  The attribute table is alittle tricky.  I'm been trying to manipulate it myself.  The first solution I offered was the least intrusive in my mind, too bad it didn't work fully.  What I found is that the attribute table is fed from module "jimu/LayerInfos/LayerInfos".  So if you look at the widget PopupMenuInfo.js around line 260  (_onTableItemClick event) as a example.  You will see how you get an instance of LayerInfos, get the layers in it, and then send it the attribute Table widget.  Pretty much the widget to widget communication that Tom had as a link above.

0 Kudos
TomSellsted
MVP Regular Contributor

Bing,

You can communicate between widgets.  Maybe this link will be of help:

Communication between widgets—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers

Regards,

Tom