EditorItem

AMD: require(["esri/widgets/Editor/support/EditorItem"], (EditorItem) => { /* code goes here */ });
ESM: import EditorItem from "@arcgis/core/widgets/Editor/support/EditorItem.js";
Class: esri/widgets/Editor/support/EditorItem
Inheritance: EditorItem→Accessor
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

EditorItem

Constructor
new EditorItem(properties)
Parameter
properties Object
optional

See the properties 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
});

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The current editing capabilities for the provided layer.

EditorItem

The name of the class.

Accessor

Indicates whether to override editable to false.

EditorItem

Indicates whether at least one edit operation is supported in capabilities.

EditorItem

A reference to the primary FormTemplate in use.

EditorItem

Indicates whether the primary FormTemplate has an unknown (invalid) field.

EditorItem

Indicates whether the associated layer is of type Table.

EditorItem

The FeatureLayer or SubtypeSublayer currently being edited.

EditorItem

The layerInfo for the provided layer.

EditorItem

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

EditorItem

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

EditorItem

Indicates whether the associated layer and its parent are visible.

EditorItem

Property Details

capabilities

Property
capabilities EditorEditingCapabilitiesreadonly

The current editing capabilities for the provided layer.

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

disabled

Property
disabled 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

Property
editable Booleanreadonly

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

Property
formTemplate FormTemplatereadonly

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.

hasInvalidFormTemplate

Property
hasInvalidFormTemplate Booleanreadonly

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

Default Value:false
See also

isTable

Property
isTable Boolean

Indicates whether the associated layer is of type Table.

Default Value:false
See also

layer

Property
layer FeatureLayer |SubtypeSublayer

The FeatureLayer or SubtypeSublayer currently being edited.

layerInfo

Property
layerInfo LayerInfo

The layerInfo for the provided layer.

supportsCreateFeaturesWorkflow

Property
supportsCreateFeaturesWorkflow Booleanreadonly

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

Default Value:false

supportsUpdateWorkflow

Property
supportsUpdateWorkflow Booleanreadonly

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

Property
visible Booleanreadonly

Indicates whether the associated layer and its parent are visible.

Default Value:false

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor

Returns true if a named group of handles exist.

Accessor

Removes a group of handles owned by the object.

Accessor

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

Type Definitions

AttachmentCapabilities

Type Definition
AttachmentCapabilities Object

The editing capabilities for attachments.

Property
enabled Boolean

Indicates whether attachments are enabled on the editable layer.

CreateCapabilities

Type Definition
CreateCapabilities Object

Specific permissions for create operations. It takes into account the Editor's layerInfo settings.

Properties

The editing capabilities for attachments.

attributes Boolean

Indicates whether attributes can be created on the editable layer.

enabled Boolean

Indicates whether create operations are enabled on the editable layer.

geometry Boolean

Indicates whether a geometry can be created on the editable layer.

reliesOnOwnerAdminPrivileges Boolean

Indicates when editing is enabled and is only due to administrative permissions. It returns false for any users if editing is generally enabled.

DefaultEditingCapabilities

Type Definition
DefaultEditingCapabilities Object

The default editing capabilities for the provided layer.

Properties

The editing capabilities for attachments.

The editing capabilities for creating features.

The editing capabilities for deleting features.

The FeatureLayer or SubtypeSublayer currently being edited.

reliesOnOwnerAdminPrivileges Boolean

Indicates when editing is enabled and is only due to administrative permissions. It returns false for any users if editing is generally enabled.

The editing capabilities for updating features.

DeleteCapabilities

Type Definition
DeleteCapabilities Object

Specific permissions for delete operations. Accounts for layerInfo settings.

Properties
enabled Boolean

Indicates whether delete operations are enabled on the editable layer.

reliesOnOwnerAdminPrivileges Boolean

Indicates when editing is enabled and is only due to administrative permissions. It returns false for any users if editing is generally enabled.

EditorEditingCapabilities

Type Definition
EditorEditingCapabilities Object

The current editing capabilities for the provided layer and read by the Editor. This takes into account what is set on the layerInfo

Properties

Specific permissions for attachment operations. It takes into account what is set on the layerInfo.

Specific permissions for create operations. It takes into account what is set on the layerInfo.

The default editing capabilities for the provided layer. This does not take into account what may be set on the layerInfo settings.

Specific permissions for delete operations. It takes into account what is set on the layerInfo.

formTemplate FormTemplate

The primary form template in use. It takes into account the Editor's layerInfos and whether a form template is set on a layerInfo within it. If so, the form template set on a layerInfo within the Editor takes precedence over a form template set directly on a FeatureLayer or SubtypeSublayer.

The associated layer.

layerInfo LayerInfo

The layer's associated layerInfo .

Specific permissions for relationship operations. It takes into account what is set on the layerInfo.

reliesOnOwnerAdminPrivileges Boolean

Indicates when editing is enabled only due to administrative permissions. It returns false for any users if editing is generally enabled.

Specific permission`s for update operations. It takes into account what is set on the layerInfo.

RelationshipCapabilities

Type Definition
RelationshipCapabilities Object

Specific permissions for relationship operations. It takes into account the Editor's layerInfo settings.

Property
enabled Boolean

Indicates whether the layer contains at least one relationship, in addition to having child workflow permissions.

UpdateCapabilities

Type Definition
UpdateCapabilities Object

Specific permissions for update operations. It takes into account the Editor's layerInfo settings.

Properties

The editing capabilities for attachments.

attributes Boolean

Indicates whether attributes can be updated on the editable layer.

enabled Boolean

Indicates whether update operations are enabled on the editable layer.

geometry Boolean

Indicates whether a geometry can be updated on the editable layer.

reliesOnOwnerAdminPrivileges Boolean

Indicates when editing is enabled and is only due to administrative permissions. It returns false for any users if editing is generally enabled.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.