4
我只是試圖找到catcomplete的文檔。我需要手冊來了解如何使用_renderItem。我發現這個http://jqueryui.com/autocomplete/#categories,但似乎沒有關於剛剛提到的例子爲_renderMenucatcomplete的文檔
_renderMenu: function(ul, items) {
var that = this,
currentCategory = "";
$.each(items, function(index, item) {
if (item.category != currentCategory) {
ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>");
currentCategory = item.category;
}
that._renderItemData(ul, item);
});
}
謝謝,但我的問題是我想添加額外的類的項目,所以按類別名稱指定它(class ='ui-corne r-all People') –
請看我的編輯:) – Elliott
哈,的確,謝謝。猴子是我,不是你:) –