0

I've seem some topics about the same issue, but all of them seem to be using the replace option.

This option doesn't seem to exist anymore in the current bloodhound.

Right now I have the following which isn't showing any result at all:

var url = 'http://demo.com';

var suggestions = new Bloodhound({
    datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
    queryTokenizer: Bloodhound.tokenizers.whitespace,
    prefetch: [],
    remote: {
        url: url + '/equipment/getSuggestions/%QUERY'
    }
});


$('#equipment-id-input').typeahead({
    highlight: true,
    minLength: 3,
    source: suggestions
});

I'm not sure if I'm doing something wrong as no errors are shown. Any suggestion?

Community
  • 1
  • 1
Alvaro
  • 40,778
  • 30
  • 164
  • 336

1 Answers1

0

I managed to make it work thanks to this answer.

Although I do not understand what does the function ttAdapter in:

$('.typeahead').typeahead(null, {
    displayKey: 'value',
    source: movies.ttAdapter()
});
Community
  • 1
  • 1
Alvaro
  • 40,778
  • 30
  • 164
  • 336