elove

Dojo.clone breaks data grid

Discussion created by elove on Feb 1, 2013
Hi,
I am utilizing the 10.1 Print Task using version 3.2 of the JavaScript API. It is working fine, except for when I need to print a graphic
symbol that highlights selected features. I found this thread:
http://forums.arcgis.com/threads/62968-Print-task-error-quot-Uncaught-RangeError-Maximum-call-stack-size-exceeded-quot?highlight=print+graphics

and tried using dojo.clone in my Identify Task, this seems to solve the printing problem, but now my dojo data grid is not populating
when I select a feature like it did before using dojo.clone.

My guess is the identifier is not being passed to the dojo store correctly when dojo.clone is used, but cannot pinpoint how to fix it. Any ideas would be greatly appreciated!!

Here is a code sample:


         function executeIdentifyTask3(geom) {
        //clear the graphics layer 
        map.graphics.clear();
       var polygonSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLine        Symbol(esri.symbol.SimpleLineSymbol.STYLE_DOT, new dojo.Color([151, 249,0,.80]), 3), new dojo.Color([151, 249, 0, 0.45]));
        var markerSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255,255,0,0.5])); 
        
        identifyParams3.geometry = geom;
        identifyParams3.mapExtent = map.extent;
        identifyTask3.execute(identifyParams3,function(response){
           
            var cornerItems = [];
           dojo.forEach(response,function(result){
               var feature = result.feature;
                //add selected feature to graphics layer
                feature.setSymbol(markerSymbol);
                map.graphics.add(feature);
    return dojo.clone(feature.attributes);
                
                if(result.layerName === 'Corner Reports'){
                    cornerItems.push(feature.attributes);
     showDocNumGrid();
     searchType="CornerReports";
     }
               
           });
           //update the data grid 
           

            var cornerStore = new dojo.data.ItemFileReadStore({data:{identifier:'OBJECTID',items:cornerItems}});
            var grid = dijit.byId('grid1');
            grid.setStore(cornerStore);


    });
   }
      

Outcomes