twitter bootstrap typeahead是否支持远程数据源?

时间:2012-05-21 05:56:57

标签: javascript twitter-bootstrap

typeahead功能是否支持twitter-bootstrap 2.0.3版中的远程数据源?

打字功能http://twitter.github.com/bootstrap/javascript.html#typeahead

的链接

1 个答案:

答案 0 :(得分:4)

你有没有尝试过:

$('.typeahead').typeahead({
    source: function (query, typeahead) {
        return $.post('/typeahead', { query: query }, function (data) {
            return typeahead.process(data);
        });
    }
});