在以下自动完成脚本中,如何将结果(值/标签/描述)传递给select:
选项?
$( ".find_group_ac" ).autocomplete({
minLength: 1,
source: function(request, response) {
$.ajax({
url: "welcome/search/",
data: { term: $(".find_group_ac").val()},
dataType: "json",
type: "POST",
success: function(data) {
response($.map(data, function(obj) {
return {
label: obj.name,
value: obj.name,
description: obj.description
};
}));
}
});
},
select: function (ui, item) {
alert (item.value);
}
})