Hybrid View

  1. #1
    Ext JS Premium Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    523
    Vote Rating
    29
    MrSparks has a spectacular aura about MrSparks has a spectacular aura about

      0  

    Question [B1] fireEvent "click" when the enter key is pressed

    [B1] fireEvent "click" when the enter key is pressed


    Hi,

    Would would be the EXTJS 4 equivalent of the following?

    Code:
    keys: [{ key: [10, 13], fn: function() {
    	var sbt001 = Ext.getCmp('mybutton'); 
    	sbt001.focus();
    	sbt001.fireEvent("click", sbt001);
    	}
    }]
    Many Thanks
    MrSparks

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    First, stop using Ext.getCmp.

    Second, why not just stb001.handler.call(stb001.scope, stb001);

  3. #3
    Ext JS Premium Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    523
    Vote Rating
    29
    MrSparks has a spectacular aura about MrSparks has a spectacular aura about

      0  

    Default


    Quote Originally Posted by jgarcia@tdg-i.com View Post
    First, stop using Ext.getCmp.

    Second, why not just stb001.handler.call(stb001.scope, stb001);
    I've altered my code to the following but the enter keypress is still being ignored/not trapped. However if I execute the handler call in my FF console, the button is triggered.
    Code:
    keys: [{ key: [10, 13], fn: function() {
            var sbt001 = Ext.getCmp('mybutton'); // will move away from this method at some point
            //sbt001.focus();
            //sbt001.fireEvent("click", sbt001);
            sbt001.handler.call(sbt001.scope, sbt001);
            }
    }]

Similar Threads

  1. "passing google maps gevents to extjs" or "simulate mouse click"
    By thomas.oberthanner in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 11 Aug 2011, 6:06 AM
  2. When click "Enter" in form panel, the IE browser will refreshed.
    By qgj2046 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 3 Dec 2009, 10:19 PM
  3. Focus on button when "enter" is pressed after writing in a text box
    By ksachdeva in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 5 Mar 2008, 6:27 AM
  4. Ajax Request - "this.fireEvent is not a function"
    By neall in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 11 Jan 2008, 7:45 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar