AnsweredAssumed Answered

Loading ajax content into infoWindow

Question asked by nobleach on May 27, 2013
Latest reply on May 30, 2013 by nobleach
I'm loading a bunch of points from JSON when my map loads. I create a graphic for each from a lat/lon pair. When a user clicks a point, I'd like to fire off a query based on a custom ID attribute I store with the graphic. I'd like to make a JSON request to the same server and pull back another JSON object to populate the infoWindow.

My problem comes in because due to the async nature of Javascript, my "details" JSON object isn't ready while creating the initial info Template. I can't find an event to latch onto to fire off the query. If I attach to the onShow event, I have no knowledge of what graphic I clicked, and that event only fires as long as there are no open info windows (users do click on other map graphics while info windows are open... there's no event for that use case)

I've hunted around for other examples of this, it seems like it would be a common thing.

Outcomes