2

I have some problems with Typeahead, I recive data from db but I have problem. I can't view any suggestions below Typeahead input.

This is my code:

var city = new Bloodhound({
  datumTokenizer: function(d) { return d.tokens; },
  queryTokenizer: Bloodhound.tokenizers.whitespace,
  limit: 10,
    remote: {
       url: base_url + 'home/autocomplete?q=%QUERY'
    }
});

var msg = city.initialize();

msg
.done(function() { console.log('success!'); })
.fail(function() { console.log('err!'); });

$('#city').typeahead(null, {
  name: 'city',
  source: city.ttAdapter()
});

Could you help me?

mmvsbg
  • 3,570
  • 17
  • 52
  • 73
  • Take a look at the answer here http://stackoverflow.com/a/21533204/203371 as this may help you fix your problem. – Ben Smith Feb 09 '14 at 23:31

0 Answers0