使用TypeAhead 0.10.4,当查询找不到结果时,我希望显示不可选的消息。我该怎么做?我尝试过在我的输入控件中添加“提前输入-无结果”,但这似乎不起作用。
<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()
});我从其他地方得到了血狗的地址
发布于 2017-05-03 04:54:45
这对我起了作用:
$('.typeahead').typeahead({ minLength: 3 }, {
....
source: addresses.ttAdapter(), templates: {
empty: '<div class="tt-no-result">No results found.</div>'
}
});https://stackoverflow.com/questions/43714584
复制相似问题