1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    95
    Vote Rating
    0
    ahsec is on a distinguished road

      0  

    Default Unanswered: jump to a record in a combobox using the keyboard

    Unanswered: jump to a record in a combobox using the keyboard


    Hello

    I'm using a combobox. I want to know how I can jump to a certain record using the keyboard. i.e:

    when opening the dropdown list, when I type "c" I'd like to jump to the records that start with "c".

    I already know that the feature exists when the combobox is editable. However, I need to have mine non-editable, and still be able to "jump to" a certain letter.

    Does anybody know how?

    Thanks

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,590
    Answers
    541
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Like this?

    Code:
    Ext.create('Ext.form.field.ComboBox', {
        editable: false,
        enableKeyEvents: true,
        renderTo: Ext.getBody(),
        store: ['Volvo', 'Saab', 'Fiat', 'Audi'],
        
        listeners: {
            keyup: function(combo, event) {
                var key = String.fromCharCode(event.getKey()),
                    boundList = combo.getPicker(),
                    store = boundList.getStore(),
                    record = store.findRecord(combo.displayField, key);
    
                if (record) {
                    boundList.highlightItem(boundList.getNode(record));
                }
            }
        }
    });

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    95
    Vote Rating
    0
    ahsec is on a distinguished road

      0  

    Default I'll try it

    I'll try it


    Thanks for your reply:-)

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    95
    Vote Rating
    0
    ahsec is on a distinguished road

      0  

    Default Thanks!

    Thanks!


    Works like charm!!!


    B.t.w

    I've been trying to use your extension to add a combo box in a cell inside a grid...but I couldn't

    Where can I contact you in private?

    Thanks

  5. #5
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,590
    Answers
    541
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    You could send me a PM on the forums.

    Please make sure you've read the forum thread and the page on my website about the extension before you send me any questions directly.

Thread Participants: 1