louchios

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

Discussion created by louchios on Apr 22, 2014
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.

Outcomes