我正在寻找一种方法来更改source
以进行打字。bootstrap typeahead - 正在更改源
例如,假设我有以下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})
然而,它没有任何效果。
可能重复://计算器.com/questions/13516396/how-to-update-the-source-option-in-bootstrap-typeahead-js) –