Select to view content in your preferred language

Graphic Err

1241
3
Jump to solution
05-08-2017 10:48 PM
NedaPeiravian
Deactivated User

I got this Err: Graphic is not defined. how should I fix it?

0 Kudos
1 Solution

Accepted Solutions
PanagiotisPapadopoulos
Esri Regular Contributor

On the function test try to pass on method goTo the geometry from the selected graphic

function test(x){
//alert(searchResults.feature.geometry);
//query features in tree layer based on objid, this will return a graphic
view.goTo(searchResults.feature.geometry)
}

also when you construct the results table add on click the array number in order later  (on test function) access the item from the searchResults array.

View solution in original post

3 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

move the following code at line 115

 var graphic = new Graphic({
getAttribute: "objectid",
popupTemplate:template
});

and add the var at the beginning

see below

0 Kudos
NedaPeiravian
Deactivated User

Hi There,

I have changed my code and moved it, but still get the Graphic is not defined Err! actually I want to view my popup template after clicking search results in the search table. but my function didn't work and the Err was Graphic is not defined.

0 Kudos
PanagiotisPapadopoulos
Esri Regular Contributor

On the function test try to pass on method goTo the geometry from the selected graphic

function test(x){
//alert(searchResults.feature.geometry);
//query features in tree layer based on objid, this will return a graphic
view.goTo(searchResults.feature.geometry)
}

also when you construct the results table add on click the array number in order later  (on test function) access the item from the searchResults array.