Items missing when scrolling lookup, but available in type search

Discussions about Cross-site Lookup
Locked
kevyn
Posts: 25
Joined: Wed Aug 26, 2015

08 Aug 2016

On a 2 part lookup list of 77 items, when I scroll down the list I sometimes cannot see some items listed, however when I start typing in part of the item text, it appears on the list. This is making the experience difficult for the users - is there anything that can be done please?


(Using Office365/Plumsail lookups)


Request items:


function (term, page) {

if (!term || term.length == 0) {

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created asc&$top=5";

}


return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Title&" +

"$filter=startswith(Project_x0020_Number, '" + encodeURIComponent(term) + "') or " +

"startswith(Title, '" + encodeURIComponent(term) + "') or " +

"startswith(Client_x0020_ID, '" + encodeURIComponent(term) + "')&$top=5";

}

Item format:

function(item) { return '<span class="csl-option">' + item["{LookupField}"] + '</span>' }

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

09 Aug 2016

We could not reproduce the issue. By default, Cross-site Lookup loads items portionally while a user is scrolling the results. You can remove '$top=' clause from the first request to get all item at once. Check if all items from the source list are there.

kevyn
Posts: 25
Joined: Wed Aug 26, 2015

11 Aug 2016

After removing the '$top=' from both parts of my request, I don't see any difference in the way the application behaves? I still see the 'loading more results' as I scroll down the list



Current request:

function (term, page) {

if (!term || term.length == 0) {

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created asc";

}



return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Title&" +

"$filter=startswith(Project_x0020_Number, '" + encodeURIComponent(term) + "') or " +

"startswith(Title, '" + encodeURIComponent(term) + "') or " +

"startswith(Client_x0020_ID, '" + encodeURIComponent(term) + "')";

}

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

12 Aug 2016

After removing $top clause, Cross-site Lookup starts loading 100 items per request.

kevyn
Posts: 25
Joined: Wed Aug 26, 2015

15 Aug 2016

Using the code above, the list still loads 5 items at a time until you scroll down

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

16 Aug 2016

Make sure that you picked a correct lookup field and saved the configuration in the lookup manager. Then re-save the form in Forms Designer and clear the browser cache.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests