How to get attribute from GraphicsLayer's popup

Discussion created by dawenx on Mar 18, 2013
Latest reply on Mar 19, 2013 by dawenx
I have some point data in csv format with x, y and list of attributes and I use a GraphicsLayer to plot them on a basemap. (Similar to ESRI's example on "Map with CSV data", http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/ags_MapwithTable.html ) A popup window is added when a point is clicked. Things work fine until I need to create a dynamic link on the popup window to retrieve more data: here I need to use a field, e.g., ID, in the attributes. Below is a walk-around I'm using which I don't like and I'm wondering what's right way to handle it. Thanks in advance for any suggestion you might provide.

   var rawAttrList = globals.map.infoWindow._contentPane.innerHTML.split("<br>");
             for (var i = 0; i < rawAttrList.length; i++) {
                 if (rawAttrList[i].split(" = ")[0] == "ID") {   
                       ID = rawAttrList[i].split(" = ")[1];