Results 1 to 3 of 3

Thread: Prevent button's click on ENTER.

  1. #1
    Sencha User
    Join Date
    Sep 2016
    Posts
    38
    Answers
    4

    Default Answered: Prevent button's click on ENTER.

    Hi all. When the button is focused and I press ENTER key, it is clicked. But I want to go to the next button when I press ENTER. I've tried to add some code in the button's afterrender listener:

    Code:
    afterrender: function (btn) {
        btn.el.on('keydown', function (e) {
            me.nextButton.focus();
        };
    }
    So, it goes to the next button, but this one is clicked too.
    Any ideas?

  2. Ok, I've found the solution by setting button's onEnterKey function to next:

    onEnterKey: function () {
    return false;
    }

  3. #2
    Sencha User
    Join Date
    Sep 2016
    Posts
    38
    Answers
    4

    Default

    Ok, I've found the solution by setting button's onEnterKey function to next:

    onEnterKey: function () {
    return false;
    }

  4. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Glad to hear you got it working, and thanks for sharing your solution with the community.

Similar Threads

  1. How to enter textfield save button is click ?
    By Detective in forum Ext: Discussion
    Replies: 1
    Last Post: 7 Jul 2014, 9:16 AM
  2. Prevent Double Click on a button
    By evs.saad in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 4 Mar 2013, 9:45 AM
  3. TextField Enter Key After Click External Button
    By Awersione in forum Ext: Q&A
    Replies: 1
    Last Post: 19 Apr 2012, 5:23 AM
  4. EventObject.Enter and Button Click
    By prabhat2486 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 30 Jan 2011, 6:03 PM
  5. render panel on click of enter button
    By kckc1234 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 17 Sep 2008, 1:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •