Skip to content
import AttachmentsViewOptions from "@arcgis/core/widgets/FeatureTable/support/AttachmentsViewOptions.js";
Inheritance:
AttachmentsViewOptionsAccessor
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.

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
PropertyTypeClass
attachmentId
readonly
attachmentInfos
readonly
candidates
readonly
declaredClass
readonly inherited
error
readonly
form
readonly
mode
readonly
"list" | "details" | "file"
objectId
readonly

attachmentId

readonly Property
Type
number | null | undefined

The ID of the attachment currently displayed in the attachments details view.

attachmentInfos

readonly Property
Type
AttachmentInfo[]

An array of attachment information objects.

Default value
[]

candidates

readonly Property
Type
FileList | null | undefined

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

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

error

readonly Property
Type
EsriError | null | undefined

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

form

readonly Property
Type
HTMLFormElement | null | undefined

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

mode

readonly Property
Type
"list" | "details" | "file"

The current mode of the attachments view. This can be either list to display a list of attachments, details to see information about a specific attachment or file to allow file uploads. If an attachmentId is also set then uploading a file will replace the attachment with that id.

Default value
"list"

objectId

readonly Property
Type
ObjectId | null | undefined

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

Methods

MethodSignatureClass
onEditComplete(): void
reset(): void

onEditComplete

Method
Signature
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
void

reset

Method
Signature
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
void