typeahead.js - Typeahead showing the wrong suggestion -
i have never used typeahead or bloodhound before, got working using local data. reason, when try use remote data. suggestions dont work intended. code:
var names = new bloodhound({ datumtokenizer: bloodhound.tokenizers.whitespace, querytokenizer: bloodhound.tokenizers.whitespace, remote: { url: '@url.action("getautonames","customer")' } }); names.initialize(); $("#customername") .typeahead({ hint: false, highlight: true, minlength: 1 }, { name: 'customernames', displaykey: 'name', source: names, limit:1 });
i have 5 json objects returning remote. these objects have name , id.
the problem is, no matter name search for. suggestions not matching input not disappear. if set limit 1. first name on list 1 displayed, if nothing in input matches name.
Comments
Post a Comment