Typeahead is not displaying Suggestions. This is a very simple city lookup. The database returns fine. The console is logging my typing. Just cannot get the return data to display.
remote data
{"recID":"3699","Name":"Dupage","City":"West Chicago","Country":"United States"}
html
<input class="typeahead" type="text" placeholder="Enter City" size="32">
script
<script type="text/javascript">
var cities = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('City'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: 'getAirports.php',
remote: {
url: 'getAirports.php?query=%QUERY',
wildcard: '%QUERY'
}
});
$('.typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
}, {
name: 'City',
display: 'City',
source: cities,
templates: {
suggestion: function (data) {
return data.City;
}
}
});
</script>