Results 1 to 6 of 6

Thread: keypress and keydown events in 3.2.1

  1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default keypress and keydown events in 3.2.1

    Hi all,

    Does Extjs 3.2.1 support keypress, keydown events? It seems to be not working with that version.

    Code:
     this.queryInput = new Ext.form.TextField({
                            fieldLabel: this.searchLabelText,
                            name: 'search',
                            allowBlank:true,
                            width: 350,
                            enableKeyEvents:true,
                            
                         });
              
         this.queryInput.on('keypress', function(e) {
                if (e.getKey()) {
                    this.updateQuery();
                }
            }, this
    );


    The keypress event is not getting fired. Can i know where i have gone wrong?

  2. #2
    Touch Premium Member msuresh's Avatar
    Join Date
    Dec 2007
    Location
    Bangalore, India
    Posts
    220
    Vote Rating
    1
      0  

    Default

    I am using something like this and it is working fine:

    PHP Code:
    listeners: {
         
    specialkey: function(fieldevent){
              if (
    event.getKey() == event.ENTER) {
                  ...
                  
    event.stopEvent();
               }
          }


  3. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Correct, specialkey is working fine for me too. How do u i add listener to keypress and keydown events? Are they even supported in Extjs3.2.1.

    Where can i get Extjs 3.2.1 api documentation?

  4. #4
    Touch Premium Member msuresh's Avatar
    Join Date
    Dec 2007
    Location
    Bangalore, India
    Posts
    220
    Vote Rating
    1
      0  

    Default

    Just now I tried inside the listener, it is working fine...

    I am using the latest version only...

    PHP Code:
    keypress : function(){
       
    alert("Yes working...")

    Documentation:
    http://dev.sencha.com/deploy/dev/doc...tField-keydown

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Yes, it works fine with latest version. But, my question is whether it works with version 3.2.1?

  6. #6
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default

    This is how i am trying to using keydown event. But its not working fine. Can i know what the mistake is?



    Code:
            this.queryInput = new Ext.form.TextField({
                            fieldLabel: this.searchLabelText,
                            name: 'search',
                            allowBlank:true,
                            width: 350,
                            enableKeyEvents:true,
             
                            
                         });
              
         this.queryInput.on('keydown', function(e) {
                if (e.getKey()) {
                    this.updateQuery();
                }
            }, this);

Similar Threads

  1. Replies: 5
    Last Post: 5 Dec 2009, 3:30 AM
  2. [2.2.1] keyUp, keyPress, keyDown listeners
    By pgioseffi in forum Ext 2.x: Bugs
    Replies: 0
    Last Post: 27 Mar 2009, 8:45 AM
  3. Editor Grid keypress and keydown
    By dtbossle in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 26 Feb 2008, 6:01 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
  •