Skip to content
import AttachmentsViewModel from "@arcgis/core/widgets/Attachments/AttachmentsViewModel.js";
Inheritance:
AttachmentsViewModelAccessor

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.

activeAttachmentInfo

Property
Type
AttachmentInfo | null | undefined

attachmentInfos

readonly Property
Type
Collection<AttachmentInfo>

A collection of AttachmentInfo defined on a feature.

See also

attachmentKeywords

Property
Type
string[] | null | undefined

An array of strings used to identify attachment(s). When attachments are displayed, this property is used to query attachments using an exact match on the keywords provided.

attachmentTypes

Property
Type
("application" | "audio" | "image" | "model" | "text" | "video")[] | null | undefined

An array of strings representing MIME types. When attachments are displayed, this property is used to query attachments based on MIME type. Valid values: application, audio, image, model, text, and video.

capabilities

Property
Type
AttachmentsCapabilities
Since
ArcGIS Maps SDK for JavaScript 4.27

Configures the attachment editing functionality that can be performed by the user.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

graphic

autocast Property
Type
Graphic | null | undefined

The graphic for the attachments.

mode

Property
Type
AttachmentsViewModelMode

The current mode performed by the user.

Default value
"view"

orderByFields

autocast Property
Type
AttachmentsOrderByInfo[] | null | undefined

An array of AttachmentsOrderByInfo indicating the display order for the attachments, and whether they should be sorted in ascending asc or descending desc order.

state

readonly Property
Type
AttachmentsViewModelState

The current state of the widget.

Default value
"ready"

supportsResizeAttachments

readonly Property
Type
boolean

Defines whether or not the feature supports resizing attachments. This depends on whether the feature layer's capabilities.attachment.supportsResize is set to true.

Methods

MethodSignatureClass
getAttachments(): Promise<AttachmentInfo[]>

getAttachments

Method
Signature
getAttachments (): Promise<AttachmentInfo[]>

Queries for the attachments on a feature. Attachments for multiple features can be queried if the layer's capabilities.operations.supportsQueryAttachments is true.

See also
Returns
Promise<AttachmentInfo[]>

When resolved, returns the AttachmentInfo of the queried feature.

Type definitions

AttachmentsViewModelState

Type definition
Type
"disabled" | "loading" | "ready"

AttachmentsViewModelMode

Type definition
Type
"add" | "edit" | "view"