Select to view content in your preferred language

Append div to InfoWindow

702
1
01-08-2014 03:22 PM
KarenRobine
Frequent Contributor
I'm trying to figure out the best way to append a Div (with a bunch of HTML) to an InfoWindow. I'm attaching InfoWindows to several different graphics layers. Each one has different formats for attributes. I'm using an onclick event to grab the attributes from the graphics, and insert it into a fairly fancy div. Now, I need the map/pan (extent-change event) to handle setting up the proper anchor with the graphic.
Whats the best method to set this up?
0 Kudos
1 Reply
TimCollyer
Regular Contributor
Can you not set the content of your InfoWindow to be the innerHTML of the div?

Something along the lines of:

var ele = document.getElementById("fancyDiv"); //you will probably be using dom.byId() to do this
infoWindow.setContent(ele.innerHTML);
0 Kudos