Hi,
We had a requirement for our customer i.e.
We had document library on the page through list view web part.
Instead of clicking ‘Download a copy’ option on the file once user hovers on the file.
There should be an option available to the user so that
Post clicking on the option respective file should be downloaded easily i.e. download to be intuitive.
Along with this user should be able to Like/Unlike the document.
First we have created a column of type Single line of text.
Number of Likes column has been added from through content type.
We have written the script in such a way that based upon root element of Likes Download a Copy icon is going to be populated.
Now we have added the below script
<script type="text/javascript">
$(function(){
setTimeout(function(){
$('.ms-vb-icon').each( function(){
var gethref= $(this).closest('tr').find('. ms-vb a').attr('href');
var downloadhref = "/sites/nucleus/_layouts/15/ download.aspx?SourceUrl=" + gethref;
});
},1000);
});
</script>
Post this user is able to see the below icon for each row of respective file
No comments:
Post a Comment