Show Doc-Type-Icon in Cross-site Lookup
Hi!
Please check out this article, it's very close to your issue: https://spform.com/cross-site-lookup/se ... office-365
Please check out this article, it's very close to your issue: https://spform.com/cross-site-lookup/se ... office-365
This link is helpful. Thank you.
However, it does not work yet. In the code I have replaced my column "Type". However, no results are displayed in the Cross ite Lookup.
My code:
Request items:
Item format:
Thanks.
However, it does not work yet. In the code I have replaced my column "Type". However, no results are displayed in the Cross ite Lookup.
My code:
Request items:
Code: Select all
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Dokumentennummer,Type&$filter=startswith(ContentTypeId, '0x0101')&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Dokumentennummer,Type&$orderby={LookupField}&$filter=(substringof('" + encodeURIComponent(term) + "',Dokumentennummer) or substringof('" + encodeURIComponent(term) + "',{LookupField}))&$top=10";
}
Code: Select all
function(item) {
return '<div style="clear: both; height: 25px;">' +
'<div style="width: 45px; float: left;"><img style="margin-top: 3px;" src="' +item.Type.Url + '"></div>' + item["{LookupField}"] + '</div>';
}
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear RMIC,
For this code to work, you need to have an Image column, with Internal Name Type. Do you have one? Make sure it's Internal Name is correct.
Also, if Cross-site Lookup gives an error, please, open browser's console, check for errors and send us a screenshot.
For this code to work, you need to have an Image column, with Internal Name Type. Do you have one? Make sure it's Internal Name is correct.
Also, if Cross-site Lookup gives an error, please, open browser's console, check for errors and send us a screenshot.
Cheers
Hello Nikita,
I do not have a picture column. I want to show the default SharePoint column "Type" in cross site lookup. The "Type" column shows the document type icon in a library (see also picture).
The code from the top gives me a "Loading failed" in the cross-site lookup, but no error in the Browser Console.
Thanks!
I do not have a picture column. I want to show the default SharePoint column "Type" in cross site lookup. The "Type" column shows the document type icon in a library (see also picture).
The code from the top gives me a "Loading failed" in the cross-site lookup, but no error in the Browser Console.
Thanks!
- Attachments
-
- Doc-Icon-CrossSiteLookup.PNG (10.8 KiB) Viewed 11877 times
Dear RMIC,
The only way to implement this is described in this article, I hope you'll find it useful: https://spform.com/cross-site-lookup/se ... office-365
The only way to implement this is described in this article, I hope you'll find it useful: https://spform.com/cross-site-lookup/se ... office-365
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests