import AttachmentsViewOptions from "@arcgis/core/widgets/FeatureTable/support/AttachmentsViewOptions.js";
const AttachmentsViewOptions = await $arcgis.import("@arcgis/core/widgets/FeatureTable/support/AttachmentsViewOptions.js");
@arcgis/core/widgets/FeatureTable/support/AttachmentsViewOptions
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
Name | Type | Summary | Class |
---|---|---|---|
The ID of the attachment currently being edited. | AttachmentsViewOptions | ||
An array of attachment information objects. | AttachmentsViewOptions | ||
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
-
The ID of the attachment currently being edited.
-
attachmentInfos
attachmentInfos AttachmentInfo[]readonly
-
An array of attachment information objects.
- Default Value:[]
-
A list of file candidates that can be added as attachments. This is typically used when a user selects files to upload.
-
An error that may occur during attachment operations. This is typically used to display error messages to the user.
-
form
form HTMLFormElement |null |undefinedreadonly
-
The HTML form element used for file uploads. This is typically used to submit files to the server.
-
The current mode of the attachments view. This can be either
list
to display a list of attachments orfile
to allow file uploads.Possible Values:"list" |"file"
- Default Value:"list"
-
The object ID of the feature associated with the attachments. This is used to identify which feature the attachments belong to.
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 | ||
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
-
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.
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}
Inherited from Accessor -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType 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"); }
-
Used to display the list view and clear temporary file data after a successful edit. It resets the
attachmentId
, clears thecandidates
, and sets the mode tolist
to display the list of attachments.ReturnsType Description void
-
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");
-
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
.ReturnsType Description void