لن يظهر jQuery AutoComplete أكثر من 10 نتائج
-
25-09-2019 - |
سؤال
أنا أستخدم الإكمال التلقائي JQuery ، وبغض النظر عن الإعدادات التي أغيرها ، لا يمكنني الحصول عليها لإظهار أكثر من 10 نتائج في القائمة المنسدلة. أستطيع أن أرى في النتائج التي تعود إلى أنني أحصل عليها جميعًا من الخادم ، لكن الواجهة الأمامية لن تظهر أكثر من 10.
$("#add_cpt_code_text").autocomplete('<%: Url.Action("SearchCPT", "ChargeCapture") %>', {
autoFill: false,
mustMatch: true,
matchContains: true,
cacheLength: 1,
maxItemsToShow: 15,
minChars: 3,
extraParams: {
LocationID: 0
},
formatItem: function (data, index, max) {
return data[1];
},
formatMatch: function (data, index, max) {
return data[1];
},
formatResult: function (data, index, max) {
return data[1];
}
}).result(function (event, data, formatted) {
if (data) {
$("#add_cpt_code_id").val(data[0]);
$("#add_cpt_code_text").val(data[1]);
}
else {
$("#add_cpt_code_id").val('');
}
});
المحلول
لقد وجدت الإجابة ، أحتاج إلى استخدام Max ، وليس MaxItemStoshow
كنت أستخدم الإكمال التلقائي JQuery-UI
لا تنتمي إلى StackOverflow