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();
}
對於原因,現在,我不能在我的自動完成字段中使用向上/向下箭頭。我甚至無法使用鼠標點擊結果中的項目。還有什麼我需要做的,以使其實際工作?