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
预输入或自动完成
谢谢你对我的工作.. –