【发布时间】:2014-06-03 08:15:31
【问题描述】:
我已经为此烦恼了一段时间。 SO和其他网站周围还有其他答案说,如果我将input的值更改为其他值,然后恢复为我的原始值,TypeAhead将显示。
在我的情况下没有任何效果。
我这样检索我的结果:
$(element).typeahead({
hint : true,
highlight : true, // This is to bold words that match the query
minLength : queryLength
}, {
name : "results",
displayKey: "value",
source : bhResults.ttAdapter()
});
之后,我尝试强制显示一个包含所有结果的下拉列表,如下所示:
window.setTimeout(function () {
$(element).typeahead('val', value);
$(element).focus();
$(element).trigger("input");
$(element).val('mood');
}, 1000);
但是,没有任何效果!
【问题讨论】: