Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: AttachmentEditor

dojo.require("esri.dijit.editing.AttachmentEditor");

Description

(Added at v2.0)
Widget that supports viewing attachments for feature layers that have attachments enabled. If the feature layers are from a feature service then the attachment editor will include the ability to create, view and delete attachments.

Samples

Search for samples that use this class.

Constructors

NameSummary
new esri.dijit.editing.AttachmentEditor(params, srcNodeRef)Creates a new AttachmentEditor object.

Methods

NameReturn typeSummary
showAttachments(graphic, featureLayer)NoneDisplay the attachment editor.
startup()NoneFinalizes the creation of the attachment editor.
Constructor Details

new esri.dijit.editing.AttachmentEditor(params, srcNodeRef)

Creates a new AttachmentEditor object.
Parameters:
<Object> params Required No parameter options.
<Node | String> srcNodeRef Required HTML element where the widget is rendered.
Sample:
map.infoWindow.setContent("<div id='content' style='width:100%'></div>");
map.infoWindow.resize(350,275);
var attachmentEditor = new esri.dijit.editing.AttachmentEditor({}, dojo.byId("content"));
attachmentEditor.startup();
Method Details

showAttachments(graphic, featureLayer)

Display the attachment editor.
Parameters:
<Graphic> graphic Required Graphic, with attachments, to display in the attachment editor.
<FeatureLayer> featureLayer Required The feature layer to display attachments for. The feature layer must have attachments enabled.
Sample:

dojo.connect(featureLayer, "onClick", function(evt) {

  //display the attachment editor in the map's info window.

  attachmentEditor.showAttachments(evt.graphic,featureLayer);

  map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));

});

startup()

Finalizes the creation of the attachment editor. Call startup() after creating the widget when you are ready for user interaction.
Show Modal