【发布时间】:2017-05-01 05:13:49
【问题描述】:
使用 TypeAhead 0.10.4,我想在查询未找到结果时显示不可选择的消息。我该怎么做呢?我尝试将 typeahead-no-results 添加到我的输入控件中,但这似乎不起作用
<input type="text" runat="server" id="addressTypeAhead" typeahead-no-results="No address found">
$('.typeahead').on('typeahead:selected', function (evt, item) {
// set hidden var
$('*[data-name="addressId"]').val(item.identifier);
})
// Instantiate the Typeahead UI
$('.typeahead').typeahead({ minLength: 3 }, {
displayKey: 'value',
valueKey: 'identifier',
items: 5,
source: addresses.ttAdapter()
});
我正在从其他地方的 Bloodhound 获取地址
【问题讨论】: