Hybrid View

  1. #1
    Ext User
    Join Date
    Mar 2007
    Vote Rating
    wannabe is on a distinguished road


    Default KeyListener, Tabpanel and rest of the site

    KeyListener, Tabpanel and rest of the site

    I've trying to mess with Tabpanel and integrating it into my site. So far so good, but it'd be really nice (IMHO) to add a KeyListener to it, so when I press a certain key, the right tab will be displayed (instead of clicking on the tab). So far so good too ...

    But when I'm in a text input field, and use that key too, the right tab will be opened as well. How do I prevent the KeyListener to work, only when I'm not in some input field? Any pointers?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Tampa, FL
    Vote Rating
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough



    The grid uses javascript and the mouse down event to disable text selections within it. When the grid has a textfield or textarea I need to allow text selections. This is similar to your problem. When the event bubbles, you need to know if you should handle it or not.

    I'm not sure if this is the best solution but it works for me and allows me to make the field names configurable:
    function yourKeyDownHandler(e){
        // this pattern should be defined somewhere else and reused for each call
         var allowPattern = /INPUT|TEXTAREA/i;
         var target = YAHOO.util.Event.getTarget(e);
         if(target && !allowPattern.test(target.tagName)){
              // do your keydown stuff
    You could also attach a key listener to every textfield and stopPropagation on each of them, but IMO that wouldn't be better it would be worse.


Similar Threads

  1. HelloWorld Dialog KeyListener and IE7 Problem
    By jongohr in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 1 May 2008, 12:30 AM
  2. tabPanel.activate vs tabPanel.activateTab
    By jon.whitcraft in forum Community Discussion
    Replies: 2
    Last Post: 10 Sep 2007, 11:21 AM
  3. New Site & New Forums
    By Webnet in forum Community Discussion
    Replies: 1
    Last Post: 4 Mar 2007, 11:17 AM
  4. KeyListener not registering
    By Domitian in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 31 Jan 2007, 12:45 PM
  5. YUI Help - KeyListener + Event
    By allaboutyui in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 1 Jan 2007, 3:04 PM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi