AnsweredAssumed Answered

Disable attributes update when feature is selected only

Question asked by DMS2 on Jan 16, 2014
Latest reply on Jan 17, 2014 by DMS2
I need to disable geometry and attribute update in my app.
The disableGeometryUpdate property of the layerInfos object works as expected but the disableAttributeUpdate property doesn't.

According to the documentation:

disableGeometryUpdate: When true,the geometry is not editable. The default value is false. Requires ArcGIS Server feature service version 10.1 or greater.
disableAttributeUpdate: If true, attributeInspector won't pop up when features in this featureLayer are selected. When adding a new feature, attributeInspector won't pop up either.



What I want is to show the attributeInspector and allow attribute editing when creating features, and show the attributeInspector but disable attribute editing when features are selected. Is there any way to do this?
There's an isEditable property of the layerInfos object which when set to false disables editing for all fields. So if I find a way of changing that property to false when I click a feature and set it to true when I create a new feature I would achieve my goal!
Any idea of how to do this?

I'm trying to do something with the templatePicker's onSelectionChange event but I'm stuck. When I click on the map to create a new feature the template is unselected again before the attributeInspector is shown so I can't use this to know when I'm creating a feature and when I'm selecting a feature.
dojo.connect(templatePicker, "onSelectionChange", function () {    var selected = templatePicker.getSelected();    if (selected) {       alert(selected.template.name);       //enable attribute editing    }else{       alert("no template");       //disable attribute editing    } });

Outcomes