Zoom To in InfoWindow - which types of infoWindows add it automatically?

Discussion created by schlot on Dec 20, 2012
I have an IdentifyTask which was likely to return multiple points because the features are colocated.  Through some examples, I saw that I needed to build an array to set the features for map.infowindow.setFeatures.
 function executeIdentifyTask(evt) {    
     identifyParams.mapExtent = map.extent; 
     identifyParams.geometry = evt; //input from address, evt is already a map point
     var inputPt = evt;
     identifyParams.geometry = evt.mapPoint;     
     inputPt = evt.mapPoint;  

      var deferred = identifyTask.execute(identifyParams);
        deferred.addCallback(function(response) {      
          // response is an array of identify result objects     
          // Let's return an array of features. 
          return, function(result) { 
            var feature = result.feature; 
            feature.attributes.layerName = result.layerName; 
              return feature;             
        // InfoWindow expects an array of features from each deferred object that you pass. If the response from the task execution  
        // above is not an array of features, then you need to add a callback like the one above to post-process the response and return an 
        // array of features. 
        map.infoWindow.setFeatures([ deferred ]);; //point type is the same coming from either method


I have the definitions set for Popup (a popup variable defined as well as including that in my map definition).

var popup = new esri.dijit.Popup({ 
            fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NULL, 
          new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]), 3), new dojo.Color([255,255,0,0.35])) 
        }, dojo.create("div"));
         var spatialReference = new esri.SpatialReference({wkid: 102100 });
        startExtent = new esri.geometry.Extent(-10723197,4186914,-9829190,4992866, spatialReference);
        map = new esri.Map("map",{extent:startExtent, infoWindow:popup} );            

With this definition, when I do an Identify, no only do I get the left/right arrows to step through any multiple records that are identified, but I also get the "zoom to" at the bottom of the infoWindow. 

Within this same code, I have a datagrid with a list of features.  I have added the zoom button based on the example DataGrid with zoom button.  I'm not sure I really want to zoom, instead I really wanted to have this also trigger the infoWindow.  Not all my attributes are in my datagrid, only an ID number and a status.  The infoWindow would show all the attributes.

function zoomRow(id){ 
      //  alertLayer.clearSelection(); 
        var query = new esri.tasks.Query(); 
      // query.text = id;
        query.where = "Server_ServerName = '" + id + "'";
        query.outFields = ['*'];
      query.returnGeometry = true;
     var zoomQueryTask = new esri.tasks.QueryTask("");
    function showAlertResults(results) {
    var feature = results.features[0];
    var content = esri.substitute(feature.attributes,infoTemplateContent);
      //  map.infoWindow.setContent(content);;

Even though I'm still calling, these infoWindows don't have the zoom to in them.  Am I going to have to go through the same steps for the queryTask that the Identify has (setting a callback on deferred etc etc) in order to get the 'zoom to' to be in my InfoWindow?  I don't really understand exactly what was triggering this in the first place.