1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| $("#keywords").autocomplete("/music/neteaseCloud/search", { width : 350, max : 30, scrollHeight: 600, resultsClass: "ac_results animated fadeInUpBig", autoFill : false, highlight : false, highlightItem: true, scroll : true, matchContains : true, multiple :false, matchSubset: false, dataType: "json", formatItem: function(row, i, max) { }, formatMatch: function(row, i, max) { return row.name + row.id; }, formatResult: function(row) { return row.id; }, parse:function(data) { if (data.data.length === 0) { return []; }else { return $.map(data.data, function(row) { return { data: row } }); }
} }).result(function(event, row, formatted) { jQuery(this).val(row.name + ' ' + row.author); addSearchResult(row.id); });
|