【发布时间】:2012-11-26 10:30:49
【问题描述】:
我正在寻找一种将source 更改为typeahed 的方法。
例如,假设我有以下 2 个列表,并且根据具体情况,我想让 typeahead 使用不同的来源。
var list1 = ["this", "is", "first", "list"],
list2 = ["second", "list", "comes", "here"];
$("selector").typeahead({source: list1})
然后,当我这样做时
$("selector").typeahead({source: list2})
并开始在输入框中输入内容,第一个列表出现在新列表下方。
我试过了
$("selector")
.removeData()
.typeahead({source: list2})
然而,它没有任何效果。
【问题讨论】:
标签: jquery twitter-bootstrap bootstrap-typeahead