Disable editing capabilites of a layer

610
3
05-25-2011 01:36 PM
JasonTrook
New Contributor II
Greetings,

I am looking to disable editing capabilities for some of my feature layers.  I modified the sample code 'Editor with toolbar' to display my project layers.  However, I only want to some of the layers to be editable and others read only.  Is there a way to do this?
My overall goal is to:
1) show both editable/non-editable layers in Legend w/ label & symbology
2) if a user tries to select non-editable layer a warning message appears
3) have info window enabled so a user can still retrieve info from non-editable features

With respect to #3 I currently get two windows to appear, 1 with the draw/edit tool and 1 with the info window.


Thanks in advance,

Jason
Tags (2)
0 Kudos
3 Replies
BjornSvensson
Esri Regular Contributor
Yes, you can have non-editable feature layers. When you add your feature layers, point it to a layer within a MapService instead of a layer within a FeatureService.

"The feature layer can be used to display features from one single layer of either a Feature Service or a Map Service. The layer can be either a (spatial) layer or a (non-spatial) table. The features in a FeatureLayer can be edited if it is based on a Feature Service."
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html
0 Kudos
JasonTrook
New Contributor II
Great, that makes sense.
I now have two legends: one displaying my Map Services and one displaying my editable Feature Services (see graphic).  Is there a good way to combine the two into a single legend (1st choice) or somehow stack one on top of the other.  So far I can't manage to reduce to size of the legend to fill up only a portion of the screen width/height.  Thanks,

Jason
0 Kudos
by Anonymous User
Not applicable
Great, that makes sense.
I now have two legends: one displaying my Map Services and one displaying my editable Feature Services (see graphic).  Is there a good way to combine the two into a single legend (1st choice) or somehow stack one on top of the other.  So far I can't manage to reduce to size of the legend to fill up only a portion of the screen width/height.  Thanks,

Jason


What about adding the map service that has everything  (use that for the legend) then when someone wants to edit load the feature service?
0 Kudos