我看了一下官方的 demo 頁面有類似的
http://jquery.bassistance.de/autocomplete/demo/
可參考 E-Mail (local) 那一欄的作法:$("#suggest13").autocomplete(emails, {
minChars: 0,
width: 310,
matchContains: true,
autoFill: false,
formatItem: function(row, i, max) {
return i + "/" + max + ": \"" + row.name + "\" [" + row.to + "]";
},
formatMatch: function(row, i, max) {
return row.name + " " + row.to;
},
formatResult: function(row) {
return row.to;
}
}); |