5
我有一个jQuery自动填充字段,一直工作得很好,直到现在。我决定使用_renderItem
,因为我想在结果中使用一些HTML。这里是我的代码:使用_renderItem类中断自动填充字段
function prepareClientField() {
var renderItemFunction = function(ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append(item.label)
.appendTo(ul);
};
$("#client_name").autocomplete({
source: clientNames,
delay: 0
}).data("autocomplete")._renderItem = renderItemFunction;
$("#client_name").focus();
}
对于原因,现在,我不能在我的自动完成字段中使用向上/向下箭头。我甚至无法使用鼠标点击结果中的项目。还有什么我需要做的,以使其实际工作?