Select to view content in your preferred language

Attachments from feature layer service not displaying in my JavaScript application.

317
0
04-22-2014 11:44 AM
AndrewL
Frequent Contributor
Hi. I just want to view the attachments of a feature service available online. I do not want to edit, delete, or add attachments.

If I open the feature service using AGOL I am able to view the attachment link when clicking on the point. However, if I try to add the feature service to my JS application, I cannot get the link to the attachments to display. Other fields display correctly.


 function createFeatureLayer(layer) {
    var infoTemplate = new esri.InfoTemplate(
    "${stormdate}",
    "${dod_txt}"
    );
    var feature = new esri.layers.FeatureLayer(layer.url, {
   infoTemplate: infoTemplate,
          mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
   outFields: ["*"],
          hasAttachments: true
          });
  attachmentEditor = new esri.dijit.editing.AttachmentEditor({}, dojo.byId("content"));
                attachmentEditor.startup();
  feature.on("click", function(evt) {
   attachmentEditor.showAttachments(evt.graphic,feature);
   map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
  });

    return feature;


Thank you for any help.
0 Kudos
0 Replies