Class: Editor

Description

Class added v2.0

Load the Editor using one of the dojo.require statements below. See the Coding Guidelines help topic for details.

dojo.require("esri.dijit.editing.Editor-all");
or
dojo.require("esri.dijit.editing.Editor");

The Editor widget provides out-of-the-box editing capabilities using an editable layer in a Feature Service. It combines the out-of-the-box TemplatePicker, AttachmentEditor, AttributeInspector and GeometryService to provide feature and attribute editing. When building editing applications, try to take advantage of the customizable out-of-the-box Editor widget when possible.

Editing behaviors:

Samples

Search for samples that use this class.  

Class hierarchy

esri.dijit.editing.Editor

Constructor

Constructor Description
esri.dijit.editing.Editor(params, srcNodeRef) Creates a new Editor object.

Constants

Constant Description
CREATE_TOOL_ARROW Arrow tool
CREATE_TOOL_AUTOCOMPLETE Autocomplete polygon tool
CREATE_TOOL_CIRCLE Circle tool
CREATE_TOOL_ELLIPSE Ellipse tool
CREATE_TOOL_FREEHAND_POLYGON Freehand polygon tool
CREATE_TOOL_FREEHAND_POLYLINE Freehand polyline tool
CREATE_TOOL_POLYGON Polygon tool
CREATE_TOOL_POLYLINE Polyline tool
CREATE_TOOL_RECTANGLE Rectangle tool
CREATE_TOOL_TRIANGLE Triangle tool
Constructor Detail

esri.dijit.editing.Editor(params, srcNodeRef)

Creates a new Editor object.
Parameters:
<Object> params Required Parameters that define the functionality of the editor widget. Create a new settings object to pass to the widget (see options).
<Object> srcNodeRef Required HTML element where the widget should be rendered.
Options:
<Object> settings

Create a new settings object that defines the cababilites of the widget.

<Map> map Required Reference to the map.
<TemplatePicker> templatePicker Optional Reference to the TemplatePicker. Use this option if you want to modify the appearance of the template picker, for example set the number of rows and columns. The following samples demonstrate setting the template picker option:

Editor widget (Selection mode)
Editor Widget with toolbar (reshape)
<String> geometryService Required Reference to the geometry service.
<Boolean> toolbarVisible Optional If true display the editing toolbar.
<Object> createOptions Optional Specify the polygon and polyline draw tools to include on the toolbar. Only applicable when toolbarVisible is true.
<String[]> polylineDrawToolsSee the constants list for valid options.
<String[]> polygonDrawToolsSee the constants list for valid options.
<Object> toolbarOptions Optional Specify the tools to include on the toolbar. Only applicable when toolbarVisible is true.
<Boolean> mergeVisibleIf true show the merge tool.
<Boolean> cutVisibleIf true show the cut tool.
<Boolean> reshapeVisibleIf true show the reshape tool.
<Object> layerInfos Optional Feature layer information
<FeatureLayer> featureLayerReference to the feature layer.
<Boolean> showObjectIDDefault is false. When true display the ObjectID field in the attribute inspector.
<Boolean> showGlobalIDDefault is false. When true display the GlobalID field in the attribute inspector.
<String[]> htmlFieldsSpecify which fields to display as a rich text editor.
Code snippets:

Create a settings object that defines the cababilities of the widget.

var settings = {
  map: map,
  geometryService: new esri.tasks.GeometryService("http://servery/arcgis/rest/services/Geometry/GeometryServer"),
  createOptions: { polygonDrawTools:[esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON] },
  layerInfos:layerInfos  
};

Pass the settings to the widget

var params = {settings: settings};
var myFeatureServiceWidget = new esri.dijit.editing.Editor(params,'divFeatureServiceDijit');
myFeatureServiceWidget.startup();