Adding multiple fields to a Cross-Site Lookup field

rss

Posted by MES5464 - Sep 3 ’13 at 01:00

I have been reading over the documentation of the cross-site lookup field and I cant figure out how to add more than one field in the dropdown item.

I have a Shows table and I want to display: ShowName, Show Start, Show End (where the start and end are dates), City, State.

I understand that the "item" parameter passed into the "Item format" function needs to be an object that carries in the additional fields. I believe that I need to modify the "Request items" function to bring in the additional fields but I do not understand how.

How do I include fields with spaces in the name?

 

Here is what I have:

 

function (term, page) {

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

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}, Show Start, Show End, Location&$orderby=Created desc&$top=10";

}

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}, Show Start, Show End, Location&$orderby={LookupField}&$filter=startswith({LookupField}, '" + term + "')&$top=10";

}

 

function(item) {

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

'<span>' + item.Show Start + ' - ' + item.Show End + '</span><br />' +

'<span>' + item.Location + '</span>'

}

Displaying 1 to 4 of 4 messages