I'm currently using the Bootstrap-typeahead plugin, this way:
$('.patients_typeahead').typeahead({
name: 'patientshomepage',
source: function (query, process) {
$.ajax({
url: 'source.php',
type: 'POST',
query: 'query=' + query,
dataType: 'JSON',
async: true,
success: function (data) {
process(data);
}
})
}
});
I want to upgrade to the latest typeahead, but I understood that the source: function()
isn't supported anymore. How can I convert my code so I could use the latest twitter-typeahead?