----- TypeError: arr is undefined http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8 Line 14 -----
var featureLayer = new esri.layers.FeatureLayer(url,{<opts>,visible:false}); var listener = dojo.connect(map,"onLayerAddResult",this,function(layer){ if (layer==featureLayer) { dojo.disconnect(listener); featureLayer.applyEdits([newGraphic],null,null,function(addResults){ // verify results }); map.removeLayer(featureLayer); } }); map.addLayer(featureLayer);
Solved! Go to Solution.
NIM081335: Feature Layer: applyEdits throws error when called before adding the layer to map
Should it still be possible to applyEdits on a layer that is not added to a map object first? Alternatively, is there a better way I can do this?
featureLayer = new esri.layers.FeatureLayer(featureCollection, { id: 'flickrLayer', infoTemplate: popupTemplate });
featureLayer = new esri.layers.FeatureLayer("http://localhost/ArcGIS/rest/services/MapName/FeatureServer");
I have exact error that prevents me updating from 2.6 to 2.8.
Look forward to seeing this fixed in next release.
Code break here
var attr = { "USAGE": status, "ACTION":"update"};
var newGraphic = new esri.Graphic(Point, null, attr, null);
featuureLayer.applyEdits([newGraphic], null, null);