jquery - Autocomplete show entire list on down arrow key -
i have applied autocomplete plugin on textbox this.
var model = []; (var = 0; < data.length; ++i) { model.push({ label: data[i].modelname, value: data[i].codemodel }); } var modeldata = model; $('#tbmodele').autocomplete({ source: function (request, response) { response($.map(modeldata, function (value) { if (value.label.tolowercase().startswith(request.term.tolowercase())) { return { label: value.label, vvalue: value.value }; } })); }, select: function (e, i) { populateotherfields(i.item.label); return false; }, open: function () { $scope.ismodeldropdownopen = true; }, minlength: 0, scroll: true });
now want open autocomplete list on pressing down arrow key of text field.
can please suggest how can that?
bind down arrow key autocomplete's search
method:
$(document).on('keydown', '#tbmodele', function() { $('#tbmodele').autocomplete('search', ''); });
Comments
Post a Comment