Skip to content
import EditorItem from "@arcgis/core/widgets/Editor/support/EditorItem.js";
Inheritance:
EditorItemAccessor
Since
ArcGIS Maps SDK for JavaScript 4.30

A predominantly read-only editable item that corresponds to the feature being updated. This class is used by the Editor widget to manage editing capabilities based on the provided layer and permissions set on it. It can be accessed through the Editor's view model's editorItems. Although the returned collection is primarily read-only, it is possible to modify its disabled property after construction. Also, it can be used in situations where custom functionality is used without the need to reference the Editor widget directly. In this scenario, the item can be constructed and used to determine the editing capabilities for a specific layer.

See also
Examples
//Create the Editor widget with a feature layer and form template
const editor = new Editor({
view: view,
layerInfos: [{
layer: featureLayer, // references an existing feature layer
formTemplate: formTemplate // references an existing form template
}]
});
// Access the EditorItem from the Editor's view model
const editorItem = editor.viewModel.editorItems.find(item => item.layer === featureLayer);
//Check if the item is editable and if so, disable it
const isEditable = editorItem?.editable;
if (isEditable) {
editorItem.disabled = true;
}
// This creates a new EditorItem instance without the need to reference the Editor widget. It determines the editing capabilities for a specific layer.
const editorItem = new EditorItem({
layer: featureLayer, // This property is required if creating a new instance of EditorItem
layerInfo: featureLayerInfo
});

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.
Example
// This creates a new EditorItem instance without the need to reference the Editor widget. It determines the editing capabilities for a specific layer.
const editorItem = new EditorItem({
layer: featureLayer, // This property is required if creating a new instance of EditorItem
layerInfo: featureLayerInfo
});

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

capabilities

readonly Property
Type
EditorEditingCapabilities

The current editing capabilities for the provided layer.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

disabled

Property
Type
boolean

Indicates whether to override editable to false. This property is typically used for temporary UI purposes. For example, if an item needs to be visible in the UI, but not editable.

Default value
false

editable

readonly Property
Type
boolean

Indicates whether at least one edit operation is supported in capabilities. It is primarily used for filtering layers eligible for editing. For UI purposes, specific permissions can still be confirmed using capabilities. Additionally, editable takes into account the value for disabled as a means to temporarily disable editing functionality.

Default value
false

formTemplate

readonly Property
Type
FormTemplate | null | undefined

A reference to the primary FormTemplate in use. A form template set within the Editor widget's layerInfos takes priority over a form template set directly on a FeatureLayer or SubtypeSublayer.

See also

hasInvalidFormTemplate

readonly Property
Type
boolean

Indicates whether the primary FormTemplate has an unknown (invalid) field. Editing is typically disabled in this scenario.

See also
Default value
false

isTable

readonly Property
Type
boolean

Indicates whether the associated layer is of type Table.

See also
Default value
false

layer

Property
Type
EditorLayerUnion

The layer currently being edited.

layerInfo

Property
Type
LayerInfo | null | undefined

The LayerInfo for the provided layer.

See also

supportsCreateFeaturesWorkflow

readonly Property
Type
boolean

Indicates whether the item supports starting a new create features workflow based on specific conditions set within the Editor.

Default value
false

supportsMergeFeaturesWorkflow

readonly Property
Type
boolean

Indicates whether the item supports starting a new merge features workflow based on specific conditions set within the Editor. Merge workflows require both update and create permissions, as they both create a new feature and update an existing feature.

supportsSplitFeatureWorkflow

readonly Property
Type
boolean

Indicates whether the item supports starting a new split feature workflow based on specific conditions set within the Editor. Split workflows require both update and create permissions, as they both create a new feature and update an existing feature.

supportsUpdateWorkflow

readonly Property
Type
boolean

Indicates whether the item supports starting a new update workflow based on specific conditions set within the Editor. This includes allowing attachments even when update is not allowed, or preventing edits when the layer or its parent are not visible.

Default value
false

visible

readonly Property
Type
boolean

Indicates whether the associated layer and its parent are visible.

Default value
false