Show Doc-Type-Icon in Cross-site Lookup

Discussions about Cross-site Lookup
Locked
RMIC
Posts: 96
Joined: Sun May 10, 2015

20 Feb 2019

Hello,

how is it possible to display the document type as an icon (doc, pdf, folder icon etc.) when select in cross site lookup?

Show as more column does not work.

Thank you!

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

21 Feb 2019

Hi!

Please check out this article, it's very close to your issue: https://spform.com/cross-site-lookup/se ... office-365

RMIC
Posts: 96
Joined: Sun May 10, 2015

22 Feb 2019

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:

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";
}
Item format:

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>';
}
Thanks.

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

26 Feb 2019

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.
Cheers

RMIC
Posts: 96
Joined: Sun May 10, 2015

27 Feb 2019

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!
Attachments
Doc-Icon-CrossSiteLookup.PNG
Doc-Icon-CrossSiteLookup.PNG (10.8 KiB) Viewed 2719 times

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

28 Feb 2019

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

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest