AttachmentsViewOptions

ESM: import AttachmentsViewOptions from "@arcgis/core/widgets/FeatureTable/support/AttachmentsViewOptions.js";
CDN: const AttachmentsViewOptions = await $arcgis.import("@arcgis/core/widgets/FeatureTable/support/AttachmentsViewOptions.js");
Class: @arcgis/core/widgets/FeatureTable/support/AttachmentsViewOptions
Inheritance: AttachmentsViewOptions→Accessor
Since: ArcGIS Maps SDK for JavaScript 4.33

AttachmentsViewOptions is a read-only class which defines what can be displayed within FeatureTable attachments. It is used to manage the state of the attachments view, including the current attachment being edited, the list of attachment information, candidates for new attachments, and any errors that may occur. It is meant to provide a user-friendly interface for managing attachments in the FeatureTable widget

It is important to note that this class does not handle the actual uploading or downloading of attachments, but rather manages the state and options for displaying attachments within the FeatureTable widget.

Property Overview

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The ID of the attachment currently being edited.

AttachmentsViewOptions

An array of attachment information objects.

AttachmentsViewOptions
FileList|null|undefined

A list of file candidates that can be added as attachments.

AttachmentsViewOptions

The name of the class.

Accessor

An error that may occur during attachment operations.

AttachmentsViewOptions

The HTML form element used for file uploads.

AttachmentsViewOptions

The current mode of the attachments view.

AttachmentsViewOptions

The object ID of the feature associated with the attachments.

AttachmentsViewOptions

Property Details

attachmentId

Property
attachmentId Number |null |undefinedreadonly

The ID of the attachment currently being edited.

attachmentInfos

Property
attachmentInfos AttachmentInfo[]readonly

An array of attachment information objects.

Default Value:[]

candidates

Property
candidates FileList |null |undefinedreadonly

A list of file candidates that can be added as attachments. This is typically used when a user selects files to upload.

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

error

Property
error Error |null |undefinedreadonly

An error that may occur during attachment operations. This is typically used to display error messages to the user.

form

Property
form HTMLFormElement |null |undefinedreadonly

The HTML form element used for file uploads. This is typically used to submit files to the server.

mode

Property
mode String |null |undefinedreadonly

The current mode of the attachments view. This can be either list to display a list of attachments or file to allow file uploads.

Possible Values:"list" |"file"

Default Value:"list"

objectId

Property
objectId Number |String |null |undefinedreadonly

The object ID of the feature associated with the attachments. This is used to identify which feature the attachments belong to.

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
void

Used to display the list view and clear temporary file data after a successful edit.

AttachmentsViewOptions

Removes a group of handles owned by the object.

Accessor
void

Use this method to reset feature-specific properties after the objectId changes.

AttachmentsViewOptions

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");
}

onEditComplete

Method
onEditComplete(){void}

Used to display the list view and clear temporary file data after a successful edit. It resets the attachmentId, clears the candidates, and sets the mode to list to display the list of attachments.

Returns
Type Description
void

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");

reset

Method
reset(){void}

Use this method to reset feature-specific properties after the objectId changes. This is useful when the feature table is displaying attachments for a different feature, allowing the widget to reset its state without losing the current objectId.

Returns
Type Description
void

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