0
我要顯示所有列表數據預輸入,但使用下面的代碼其顯示只有6焦點記錄預輸入文本框typeahead.js獵犬與建議引擎限制不工作只顯示6條
var subproduct = new Bloodhound({
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.Text);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: SubProductList
});
function subproducttypehead(q, sync) {
if (q === '') {
sync(subproduct.all()); // This is the only change needed to get 'ALL' items as the defaults
} else {
subproduct.search(q, sync);
}
}
var typeaheadsub = $('#subproduct');
typeaheadsub
.typeahead({
minLength: 0,
highlight: true
},
{
displayKey: 'Text',
source: subproducttypehead
});
var subSelectedHandler = function (eventObject, suggestionObject, suggestionDataset) {
$("#subproduct_id")[0].value=suggestionObject.Value;
};
typeaheadsub.on('typeahead:selected', subSelectedHandler);
}
哪有我從顯示在SubProductList1
預輸入或自動完成
謝謝你對我的工作.. –