import EditorItem from "@arcgis/core/widgets/Editor/support/EditorItem.js";
            const EditorItem = await $arcgis.import("@arcgis/core/widgets/Editor/support/EditorItem.js");
            @arcgis/core/widgets/Editor/support/EditorItem
        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
//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
- 
  
  
  
  
  
  
  
  
    Parameterproperties ObjectoptionalSee 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
| 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  | 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  | EditorItem | ||
| The layer 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 merge features workflow based on specific conditions set within the Editor. | EditorItem | ||
| Indicates whether the item supports starting a new split feature 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
- 
  
  capabilitiesPropertycapabilities EditorEditingCapabilitiesreadonly
- 
  
    The current editing capabilities for the provided layer. 
- 
  
  editablePropertyeditable 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
 
- 
  
  formTemplatePropertyformTemplate FormTemplate |null |undefinedreadonly
- 
  
    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. 
- 
  
  hasInvalidFormTemplatePropertyhasInvalidFormTemplate Booleanreadonly
- 
  
    Indicates whether the primary FormTemplate has an unknown (invalid) field. Editing is typically disabled in this scenario. - Default Value:false
- See also
 
- 
  
  isTablePropertyisTable Boolean
- 
  
    Indicates whether the associated layer is of type Table.- Default Value:false
- See also
 
- 
  
  layerPropertylayer GeoJSONLayer |FeatureLayer |OrientedImageryLayer |SceneLayer |SubtypeSublayer |KnowledgeGraphSublayer |null |undefined
- 
  
    The layer currently being edited. 
- 
  
    The layerInfo for the provided layer. - See also
 
- 
  
  supportsCreateFeaturesWorkflowPropertysupportsCreateFeaturesWorkflow Booleanreadonly
- 
  
    Indicates whether the item supports starting a new create features workflow based on specific conditions set within the Editor. - Default Value:false
 
- 
  
  supportsMergeFeaturesWorkflowPropertysupportsMergeFeaturesWorkflow Booleanreadonly
- 
  
    Indicates whether the item supports starting a new merge features workflow based on specific conditions set within the Editor. Merge workflows require both updateandcreatepermissions, as they both create a new feature and update an existing feature.
- 
  
  supportsSplitFeatureWorkflowPropertysupportsSplitFeatureWorkflow Booleanreadonly
- 
  
    Indicates whether the item supports starting a new split feature workflow based on specific conditions set within the Editor. Split workflows require both updateandcreatepermissions, as they both create a new feature and update an existing feature.
- 
  
  supportsUpdateWorkflowPropertysupportsUpdateWorkflow 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 updateis not allowed, or preventing edits when the layer or its parent are not visible.- Default Value:false
 
- 
  
  visiblePropertyvisible Booleanreadonly
- 
  
    Indicates whether the associated layer and its parent are visible. - Default Value:false
 
Method Overview
| 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
- 
  
  
  
  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();ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed. groupKey *optionalKey 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. 
- 
  
  hasHandlesInheritedMethodhasHandles(groupKey){Boolean}Inherited from Accessor
- 
  
  
    Returns true if a named group of handles exist. ParametergroupKey *optionalA group key. ReturnsType Description Boolean Returns trueif 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"); }
- 
  
  
  
  Inherited from Accessor
- 
  
  
    Removes a group of handles owned by the object. ParametergroupKey *optionalA group key or an array or collection of group keys to remove. Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
Type Definitions
- 
  
  CreateCapabilitiesType DefinitionCreateCapabilities Object
- 
  
    Specific permissions for create operations. It takes into account the Editor's layerInfo settings. - Properties
- 
  attachments AttachmentCapabilitiesThe editing capabilities for attachments. attributes BooleanIndicates whether attributes can be created on the editable layer. enabled BooleanIndicates whether create operations are enabled on the editable layer. geometry BooleanIndicates whether a geometry can be created on the editable layer. reliesOnOwnerAdminPrivileges BooleanIndicates when editing is enabled and is only due to administrative permissions. It returns falsefor any users if editing is generally enabled.
 
- 
  
  DefaultEditingCapabilitiesType DefinitionDefaultEditingCapabilities Object
- 
  
    The default editing capabilities for the provided layer. - Properties
- 
  attachments AttachmentCapabilitiesThe editing capabilities for attachments. create CreateCapabilitiesThe editing capabilities for creating features. delete DeleteCapabilitiesThe editing capabilities for deleting features. The layer currently being edited. reliesOnOwnerAdminPrivileges BooleanIndicates when editing is enabled and is only due to administrative permissions. It returns falsefor any users if editing is generally enabled.update UpdateCapabilitiesThe editing capabilities for updating features. 
 
- 
  
  DeleteCapabilitiesType DefinitionDeleteCapabilities Object
- 
  
    Specific permissions for delete operations. Accounts for layerInfo settings. 
- 
  
  EditorEditingCapabilitiesType DefinitionEditorEditingCapabilities 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
- 
  attachments AttachmentCapabilitiesSpecific permissions for attachment operations. It takes into account what is set on the layerInfo. create CreateCapabilitiesSpecific permissions for create operations. It takes into account what is set on the layerInfo. defaults DefaultEditingCapabilitiesThe default editing capabilities for the provided layer. This does not take into account what may be set on the layerInfo settings. delete DeleteCapabilitiesSpecific permissions for delete operations. It takes into account what is set on the layerInfo. formTemplate FormTemplate|null|undefinedThe primary form template in use. It takes into account the Editor's layerInfos and whether a form template is set on a layerInfowithin 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. The layer's associated layerInfo . relationship RelationshipCapabilitiesSpecific permissions for relationship operations. It takes into account what is set on the layerInfo. reliesOnOwnerAdminPrivileges BooleanIndicates when editing is enabled only due to administrative permissions. It returns falsefor any users if editing is generally enabled.update UpdateCapabilitiesSpecific permission`s for update operations. It takes into account what is set on the layerInfo. 
 
- 
  
  RelationshipCapabilitiesType DefinitionRelationshipCapabilities Object
- 
  
    Specific permissions for relationship operations. It takes into account the Editor's layerInfo settings. 
- 
  
  UpdateCapabilitiesType DefinitionUpdateCapabilities Object
- 
  
    Specific permissions for update operations. It takes into account the Editor's layerInfo settings. - Properties
- 
  attachments AttachmentCapabilitiesThe editing capabilities for attachments. attributes BooleanIndicates whether attributes can be updated on the editable layer. enabled BooleanIndicates whether update operations are enabled on the editable layer. geometry BooleanIndicates whether a geometry can be updated on the editable layer. reliesOnOwnerAdminPrivileges BooleanIndicates when editing is enabled and is only due to administrative permissions. It returns falsefor any users if editing is generally enabled.