Any info Window that shows more than one record?

621
4
08-29-2013 11:26 AM
JoseSanchez
Occasional Contributor III
Hi all

Is there any Info Window that shows more than one record of the feature selected?

Thanks
0 Kudos
4 Replies
ZachLiu1
Occasional Contributor II
1, acquire a group of features you want to show in the infoWindow (through query, identify, etc),

2, Create an empty list, loop through features and set an infoTemplate with title and content to each feature using "feature.setInfoTemplate(infoTemplate)", push each feature into the list.

3, map.infoWindow.setFeatures(your list of features)

4,show your infoWindow.
0 Kudos
JasonZou
Occasional Contributor III
Yes, you can. An info window is just a popup to display information. You can use infoWindow.setContent to define whatever you like. However, when you define an infoTemplate for a layer, be careful though since the default behavior would be to display the info window for the feature you clicked on. Better not to revise the default behavior. If you really like to modify it, then define an onClick event handler to define the custom behavior.
0 Kudos
JoseSanchez
Occasional Contributor III
Any source code that I can test with this functionality?
0 Kudos
VinayBansal
Occasional Contributor II
Here is the sample...
https://developers.arcgis.com/en/javascript/jssamples/query_showinfowindow.html

You can also use map.infoWindow.setFeatures(<<array of features>>); to set features to infowindow template.
0 Kudos