Select to view content in your preferred language

Popup contents

807
2
Jump to solution
01-30-2014 05:49 AM
Dianede_lanfranchi
Emerging Contributor
Hello,

I'm trying to get the ID of a point using this sample

the intersting part of the code is here
connect.connect(popup, "onSelectionChange", function(){                 displayPopupContent(popup.getSelectedFeature());                     });

which call
            function displayPopupContent(feature){                 if(feature){                     var content = feature.getContent();                     registry.byId("leftPane").set("content", content);                   }             }


I'd like to get the value of the "content" variable, I could get it using leftPane but my goal is to get it before it goes to the leftPane. If I alert(content) it simply return a [object htmldivelement]. Btw, the content that appears in the leftPane is just an ID in my case.
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Hi Diane,

You can get this by calling the feature variable passed to the 'displayPopupContent' function.  Ex:

function displayPopupContent(feature){                 if(feature){                     console.log(feature.attributes.ID);                 } }

View solution in original post

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Diane,

You can get this by calling the feature variable passed to the 'displayPopupContent' function.  Ex:

function displayPopupContent(feature){                 if(feature){                     console.log(feature.attributes.ID);                 } }
0 Kudos
Dianede_lanfranchi
Emerging Contributor
Hi Jake, that's exactly what I was looking for, thanks alot !
0 Kudos