0
我正在使用bootstrap3 typeahead,但我有一些情況,當我的API返回很多結果(約40),但鍵入彈出窗口8結果。Bootstrap3 typeahead limit
我試圖解決這個使用
limit: 30
,但沒有奏效。
如何將其更改爲僅顯示8個結果?
順便說一句,我的預輸入是
$('#postcode').typeahead({
source: function (query, process) {
var ajaxResponse;
$.ajax({
url: "my_url",
type: "GET",
cache: false,
success : function (response) {
process(response.addresses);
}
});
},
limit: 30,
minLength: 2,
displayText: function(item) {
return item.full_description;
},
updater: function(item) {
// some func here
return item;
}
});
您可能希望通過顯示更正的代碼來改善您的答案。官方文件的鏈接也有助於支持您的聲明。 –