//Code for Data Download button public function dataDownload():void { var featureSet:FeatureSet = new FeatureSet(ArrayCollection(myFeatureLayer.graphicProvider).toArray()); var records:Array = featureSet.attributes; var exportSet:Array = new Array(); for (var i:int=0; i<records.length; i++){ if (myMap.extent.intersects(records.geometry)) { exportSet.push(records); } } ssoDataGrid.dataProvider = new ArrayList(exportSet); }
Solved! Go to Solution.
public function dataDownload():void { var featureCollection:ArrayCollection = myFeatureLayer.graphicProvider as ArrayCollection; var exportSet:Array = []; for (var i:int=0; i < featureCollection.length; i++){ var graphic:Graphic = featureCollection.getItemAt(i) as Graphic; if (myMap.extent.intersects(graphic.geometry)) { exportSet.push(graphic); } } OR for each (var graphic:Graphic in featureCollection){ if (myMap.extent.intersects(graphic.geometry)) { exportSet.push(graphic); } } ssoDataGrid.dataProvider = new ArrayList(exportSet); }
public function dataDownload():void { var featureCollection:ArrayCollection = myFeatureLayer.graphicProvider as ArrayCollection; var exportSet:Array = []; for (var i:int=0; i < featureCollection.length; i++){ var graphic:Graphic = featureCollection.getItemAt(i) as Graphic; if (myMap.extent.intersects(graphic.geometry)) { exportSet.push(graphic); } } OR for each (var graphic:Graphic in featureCollection){ if (myMap.extent.intersects(graphic.geometry)) { exportSet.push(graphic); } } ssoDataGrid.dataProvider = new ArrayList(exportSet); }
exportSet.push(graphic.attributes);
and the array was populated with everything correctly. Thanks again very much!