我正在尝试查找可工作的Twitter Bootstrap补全示例,该示例将进行Ajax调用以填充其下拉菜单。
我已经有一个现有的jQuery自动完成示例,其中定义了Ajax URL以及如何处理响应。
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
var options = { minChars:3, max:20 };
$("#runnerquery").autocomplete('./index/runnerfilter/format/html',options).result(
function(event, data, formatted)
{
window.location = "./runner/index/id/"+data[1];
}
);
..
我需要做哪些更改才能将它转换为typeahead示例?
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
var options = { source:'/index/runnerfilter/format/html', items:5 };
$("#runnerquery").typeahead(options).result(
function(event, data, formatted)
{
window.location = "./runner/index/id/"+data[1];
}
);
..
我要等待 'Add remote sources support for typeahead' 这个问题得到解决。