Navoneel Navoneel - 1 year ago 87
jQuery Question

Autocomplete show entire list on down arrow key

I have applied autocomplete plugin on a textbox like this.

var model = [];
for (var i = 0; i < data.length; ++i) {
model.push({ Label: data[i].ModelName, Value: data[i].CodeModel });
var modelData = model;
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) {
return false;
open: function () {
$scope.isModelDropdownOpen = true;
minLength: 0,
scroll: true

Now I want to open the autocomplete list on pressing down arrow key of that text field.

Can anyone please suggest how I can do that?

Answer Source

Bind the down arrow key to autocomplete's search method:

$(document).on('keydown', '#tbmodele', function() {
   $('#tbmodele').autocomplete('search', '');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download