我使用以下源标签实现了我喜欢的功能:
source: function (request, response) {
// delegate back to autocomplete, but extract the last term
response($.ui.autocomplete.filter(availableTags, extractLast(request.term)));
},
我通过使用以下源标签实现了新功能:
source: function (request, response) {
// Using a custom source callback to match only the beginning of terms
var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term), "i");
response($.grep(availableTags, function (item) {
return matcher.test(item);
}));
}
我怎样才能结合这两个源标签,以便我可以同时拥有两者的功能?