twitter/bootstrap — Issue #1997: Update typeahead() data-source option.
Author: alepee
Created: 2012-02-15 17:41:23+00:00
State: open

I didn't find how to update data-source with typeahead. I tried to make it work simply with a new typehead() call with new values, but it does not update at all.

The first call works perfectly :) but the second one does.. nothing :(

$('select').change(function() {
var id = $(this).val();
$.getJSON(url + id, function(data) {
$('input').typeahead({
source: data
});
$('input.hide').slideDown(120);
});
});