We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I am just wondering what is the best way to utilise more than two key:value pairs?
key:value
Here is a jsFIddle test that seems to be working, with:
horsey(document.querySelector('input'), { source: [{ list: [ { value: 'banana', text: 'Bananas from Amazon', description: '[ bananas are yellow ]'}, { value: 'apple', text: 'Red apples from New Zealand', description: '[ apples are red ]' }, { value: 'orange', text: 'Oranges from Moscow', description: '[ oranges are orange ]'}, { value: 'lemon', text: 'Juicy lemons from Amalfitan Coast', description: '[ lemons are green ]'} ]}], getText: 'text', getValue: 'value', getValue: 'description', renderItem: function (li, suggestion) { var image = "<img class=\"autofruit\" src=\"" + fruits[ suggestion.value] + "\">"; li.innerHTML = image + suggestion.text + " " + "<div class=\"second\">" + suggestion.description + "</div>"; } });
As you can see, getValue is used twice, which is probably not how it was intended to be used?
getValue
Matches don't occur as expected on description, however, if it is not called via getValue (eg searches for are will only return one suggestion).
description
are
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I am just wondering what is the best way to utilise more than two
key:value
pairs?Here is a jsFIddle test that seems to be working, with:
As you can see,
getValue
is used twice, which is probably not how it was intended to be used?Matches don't occur as expected on
description
, however, if it is not called viagetValue
(eg searches forare
will only return one suggestion).The text was updated successfully, but these errors were encountered: