【发布时间】:2012-01-19 21:29:06
【问题描述】:
我需要在自动完成时将行数限制为 10。数据来自分贝。有没有像'maxrows'之类的属性?我不想添加滚动条。
请提前建议方法谢谢。
我的代码是:
$("#iIdlbl").autocomplete({
source : function(request, response) {
var value = jQuery("#iIdlbl").val();
$.ajax( {
url : 'getiId.html',
dataType : 'json',
data : {
filter : value
},
success : function(data) {
response(jQuery.map(data.iList,function(item) {
return {
value : item.iId,
key : item.iId
};
}));
},
error : function(XMLHttpRequest,textStatus,errorThrown) {
$.loader('close');
}
});
},
minLength : 0,
open : function() {
$(this).removeClass(
"ui-corner-all").addClass(
"ui-corner-top");
},
close : function() {
$(this).removeClass(
"ui-corner-top").addClass(
"ui-corner-all");
},
select : function(event, ui) {
searchById(ui.item.value);
}
});
【问题讨论】:
标签: jquery-ui autocomplete jquery-ui-autocomplete