$("#userName").autocomplete(emails, {
minChars: 0,
width: 650,
matchContains: false,
autoFill: false,
formatItem: function(row, i, max) {
return "<span style=\"font-size:30px;\">"+i + "/" + max + ": \"" + row.name + "\" [" + row.to + "] </span>";
},
formatMatch: function(row, i, max) {
return row.to;
},
formatResult: function(row) {
return row.name;
}
minChars: 0,
width: 650,
matchContains: false,
autoFill: false,
formatItem: function(row, i, max) {
return "<span style=\"font-size:30px;\">"+i + "/" + max + ": \"" + row.name + "\" [" + row.to + "] </span>";
},
formatMatch: function(row, i, max) {
return row.to;
},
formatResult: function(row) {
return row.name;
}
});
注意: matchContains: ‘word’, 改成 matchContains: false, 可搜索中文