RE: Using ink sketch control in a SharePoint form to place markings on an image from Tablets, iPad, or PC
This blog post about adding ink notes to a picture is perfect for a form we need to create but I am wondering if it can be modified to use the attachment to a list item instead of storing a separately uploaded file.
Using ink sketch control in a SharePoint form to place markings on an image from Tablets, iPad, or PC
I have looked at the document on Getting and setting SharePoint form field values but it doesn't mention how to get a url for an attached file. I know I have done something like this before with Forms Designer in order to display attached image files on an expense report, however, that was at a previous job so I no longer have access to how I did it.
This would have been about three years ago, and I am sure that Dmitry Kozlov was the one who helped me with it.
Using ink sketch control in a SharePoint form to place markings on an image from Tablets, iPad, or PC
I have looked at the document on Getting and setting SharePoint form field values but it doesn't mention how to get a url for an attached file. I know I have done something like this before with Forms Designer in order to display attached image files on an expense report, however, that was at a previous job so I no longer have access to how I did it.
This would have been about three years ago, and I am sure that Dmitry Kozlov was the one who helped me with it.
City of Nampa
Idaho
United States of America
Idaho
United States of America
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Hello!
You can use this code on Edit Form to use attached documents as background:
But for this code to work, you need to make sure that all Items have an image attached to them during creation.
You can use this code on Edit Form to use attached documents as background:
Code: Select all
var itemID = GetUrlKeyValue('ID');
//Takes file name from the first attachment:
var fileName = $('#idAttachmentsTable tr td.ms-vb').eq(0).text();
fd.field("PictureURL").value($.trim("https://yourDomain.sharepoint.com/sites/yourSite/Lists/yourList/Attachments/" + itemID + "/" + fileName));
var url = fd.field('PictureURL').value();
$('.sketch').css('background-image', 'url("' + url + '")');
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests