I got this Err: Graphic is not defined. how should I fix it?
Solved! Go to Solution.
On the function test try to pass on method goTo the geometry from the selected graphic
function test(x){
//alert(searchResults
//query features in tree layer based on objid, this will return a graphic
view.goTo(searchResults
}
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.
move the following code at line 115
var graphic = new Graphic({
getAttribute: "objectid",
popupTemplate:template
});
and add the var at the beginning
see below
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.
On the function test try to pass on method goTo the geometry from the selected graphic
function test(x){
//alert(searchResults
//query features in tree layer based on objid, this will return a graphic
view.goTo(searchResults
}
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.