mercredi 29 avril 2015

How to highlight a autocomplete list using the the Up key and the Down key (Ember.js)

I have a auto complete and i will like to go thru the list using the up and down key to be able to highlighted here it is a example that how I want to be able to work http://ift.tt/1DWZ6on. I created a auto complete jsbin for the purpose http://ift.tt/1P845Jg

App.AutocompleteController = Ember.Controller.extend({
  searchText: null,
     searchResults: function() {
        var searchText = this.get('searchText');
        if (!searchText) { return; }

        var regex = new RegExp(searchText, 'i');
        return ['one', 'two', 'three'].filter(function(name) {
          return name.match(regex);
        });
      }.property('searchText')
    });




Aucun commentaire:

Enregistrer un commentaire