Disabling the Attributes Editor for the Editor Widget and Template Picker

1521
7
08-28-2013 10:09 AM
IanPeebles
Occasional Contributor III
Is there a way to disable the attributes editor for the editor widget and template picker?  Each time a feature is added, the attribute editor comes up automatically.  For my purposes, I am wanting to disable this functionality.  Can this be done?
0 Kudos
7 Replies
KellyHutchins
Esri Frequent Contributor
The Editor widget is comprised of a bunch of other widgets including the: TemplatePicker, AttributeInspector, Edit Toolbar etc. If you don't want the attribute inspector to display take a look at the Editing without the Editor sample. This sample shows how to use the individual components of the Editor that you are interested in to edit features.

https://developers.arcgis.com/en/javascript/jssamples/ed_feature_creation.html
0 Kudos
IanPeebles
Occasional Contributor III
The Editor widget is comprised of a bunch of other widgets including the: TemplatePicker, AttributeInspector, Edit Toolbar etc. If you don't want the attribute inspector to display take a look at the Editing without the Editor sample. This sample shows how to use the individual components of the Editor that you are interested in to edit features.

https://developers.arcgis.com/en/javascript/jssamples/ed_feature_creation.html


Kelly, this is sort of what I am looking for, but I need to be able to select features, add to selection, then delete selected features.  Also, I need to be able to move and modify features.

I was looking at using this existing widget because it does that already.  Are there any other options?
0 Kudos
KellyHutchins
Esri Frequent Contributor
Haven't tested it fully but you might try passing in an attribute inspector that isn't displayed when you create the editor.   Something like this:

          var layers = arrayUtils.map(evt.layers, function(result) {
            return { featureLayer: result.layer };
          });
          var attributeInspector = new AttributeInspector({layerInfos: layers}, dojo.create("div"));
          var settings = {
            attributeInspector: attributeInspector,
            map: map,
            templatePicker: templatePicker,
            layerInfos: layers,
            toolbarVisible: true,
            createOptions: {
              polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ],
              polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON,
                Editor.CREATE_TOOL_CIRCLE,
                Editor.CREATE_TOOL_TRIANGLE,
                Editor.CREATE_TOOL_RECTANGLE
              ]
            },
            toolbarOptions: {
              reshapeVisible: true
            }
          };

0 Kudos
IanPeebles
Occasional Contributor III
Haven't tested it fully but you might try passing in an attribute inspector that isn't displayed when you create the editor.   Something like this:

          var layers = arrayUtils.map(evt.layers, function(result) {
            return { featureLayer: result.layer };
          });
          var attributeInspector = new AttributeInspector({layerInfos: layers}, dojo.create("div"));
          var settings = {
            attributeInspector: attributeInspector,
            map: map,
            templatePicker: templatePicker,
            layerInfos: layers,
            toolbarVisible: true,
            createOptions: {
              polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ],
              polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON,
                Editor.CREATE_TOOL_CIRCLE,
                Editor.CREATE_TOOL_TRIANGLE,
                Editor.CREATE_TOOL_RECTANGLE
              ]
            },
            toolbarOptions: {
              reshapeVisible: true
            }
          };



I will have a look at this, but is there any documentation on how the editor widget can be customized?  Surely, I can disable functionality that I do not want with the editor widget and template picker.
0 Kudos
KellyHutchins
Esri Frequent Contributor
I will have a look at this, but is there any documentation on how the editor widget can be customized?  Surely, I can disable functionality that I do not want with the editor widget and template picker.



Ian,

This type of capability is currently not documented for the Editor widget. In general the Editor widget is designed to be used as a whole. You can customize various options such as which tools display on the toolbar and that is documented.
0 Kudos
IanPeebles
Occasional Contributor III
Ian,

This type of capability is currently not documented for the Editor widget. In general the Editor widget is designed to be used as a whole. You can customize various options such as which tools display on the toolbar and that is documented.


Also, all I want to do is disable the attributes editor for the template picker and editor widget.  Surely there is a way to do this?  The reason being, I do not want users adding in features and the attributes coming up at all times.  I want to use all of the functionality except for the attributes editor.  Is it possible to disable the editor widget?  If so, can I do this under toolbarOptions?

For instance, I can add the following tools under the toolbar options.

mergeVisible: true,
cutVisible: true
0 Kudos
KellyHutchins
Esri Frequent Contributor
Ian,

No there isn't an option that will allow you to disable the display of the attribute inspector when working with the editor widget. That said the code snipipet I provided earlier should prevent the attribute inspector from displaying. Have you tested?  As I  mentioned earlier if you need to perform customizations to the Editor beyond those listed in the documentation your best bet is to use the individual editing widgets (Attribute Inspector, Template Picker, Edit Toolbar, Attachment Editor) instead of using the Editor widget.

Kelly
0 Kudos