I've got the script below. I've noticed that the fetching of data works perfectly (verified by console.log(response), showing precisely what's supposed to be fetched). However, in the list of possible options that displays, only some of them are shown. Sometime it's all of them, sometimes a few or even none. I can't see any system in it.
var users = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
//prefetch: { url: "/Worker/HintUser", cache: false, ttl: 15000 },
remote: {
wildcard: 'partial',
rateLimitWait: 100,
url: "/Worker/HintUser?input=partial",
transform: function (response) { console.log(response); return response; }
}
});
$("#remoteFetch").typeahead(
{ hint: true, highlight: true, minLength: 1 },
{ name: 'users', source: users });
I've tried using and skipping prefetch, not keeping the cache etc. Same result all the time. What am I doing wrong?
I've found quite a few examples showing how it's working but I fail to see the relevant difference. Or perhaps missing a nice trick they apply.