This project is read-only.
1
Vote

Not working in list view with filter

description

works fine with normal list view but when filter is applied to list view, then javascript is rendered instead of link.

below text will appear in the column instead of attachment links

<script type="text/javascript" src="/_layouts/SP2010.Controls.AttachmentField/jquery-1.8.2.min.js" mce_src="/_layouts/SP2010.Controls.AttachmentField/jquery-1.8.2.min.js" ></script><script type="text/javascript"> var listname='{0733A489-96FF-450E-99EC-3DBB16290D8A}'; var currentWeb='http://server'; $(document).ready(function() { var soapEnv ="<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>\ <soap:Body>\ <GetAttachmentCollection xmlns='http://schemas.microsoft.com/sharepoint/soap/'>\ <listName>"+listname+"</listName>\ <listItemID>1</listItemID>\ </GetAttachmentCollection>\ </soap:Body>\ </soap:Envelope>"; $.ajax({ url: currentWeb + "/_vti_bin/lists.asmx", type: "POST", dataType: "xml", data: soapEnv, async: true, complete: processResult0, contentType: "text/xml; charset=\"utf-8\""}); }); function processResult0(xData, status) { $("#data_1").empty(); $(xData.responseXML).find("Attachment").each(function() { $("#data_1").append("<img src=\"/_layouts/images/attachhd.gif\" ><span style=\"position:relative;top:-4px;\"><a href='"+$(this).text()+"'>" +GetFilename($(this).text()) + "</a></span></img></br>"); }); if(!$("#data_1").html()) { $("#data_1").append("<img src=\"/_layouts/images/info16by16.gif\" /> <span style=\"position:relative;top:-4px;\">No attachments</span>"); } } function GetFilename(path) { var last_index = path.lastIndexOf('/'); return path.substring(last_index+1, path.length); } </script><div id="data_1"><img src="/_layouts/images/SP2010.Controls.AttachmentField/Kpiprogressbar.gif"></div>

file attachments

comments

smart84 wrote Mar 28, 2014 at 12:20 PM

Thanks. It will be fixed on new version for SharePoint 2013. Unfortunally, this version is used XSLT