I know this code works generally, but when I tied to use it after executing a query task, I can not set map extent to the returned graphics layer. Don't know what goes wrong.function showResults(featureSet){
//remove all graphics on the maps graphics layer
map.graphics.clear();
//Performance enhancer - assign featureSet array to a single variable.
var resultFeatures = featureSet.features;
$.each(resultFeatures, function(index, featureItem){
featureItem.setSymbol(symbol);
featureItem.setInfoTemplate(infoTemplate);
map.graphics.add(featureItem);
});
var extGraphics = GraphicsUtils.graphicsExtent(map.graphics.graphics);
map.setExtent(extGraphics);
}