1. #1
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default With the doubletap, will tap always be called, or is that a bug?

    With the doubletap, will tap always be called, or is that a bug?


    Just a bit annoying, really.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    Tap will always be called. The alternative would be to have the tap event fired after a delay which would be more of a bug. In the meantime there are plenty ways to work around it.

  3. #3
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    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


    Seems that this is the exact same paradigm as "click" and "double click", which developers have managed for many years now.

  4. #4
    Ext User tobinharris's Avatar
    Join Date
    Apr 2008
    Location
    Leeds, UK
    Posts
    34
    Vote Rating
    1
    tobinharris is on a distinguished road

      0  

    Default


    This should help. Add to your Container/Component or whatever...

    PHP Code:
    setupEventHandlers: function(){
        
    this.mon(this.el, {
            
    tap: function(e){            
                if(
    this.delayedTask == null){            
                    
    //setup a delayed task that is called IF double click is not later detected
                    
    this.delayedTask = new Ext.util.DelayedTask(
                      function(){
                        
    this.doSomethingInteresting(); 
                        
    this.delayedTask null;
                      }, 
    this);  
                    
                    
    //once setup, need to start the clock (with reasonable time to cancel)
                    
    this.delayedTask.delay(300);
                }                
            }, 
            
    doubletap: function(e){                
                
    //Cancel and clear the delayed Task if it's there
                //It would be set by the first single tap, but don't need it now we're on a double.
                
    if(this.delayedTask != null){
                  
    this.delayedTask.cancel();
                  
    this.delayedTask null;
                }                        
                
                
    //handle the double click as usual
                
    this.doSomethingReallyInteresting();
            },        
            
    scopethis
        
    });
    }, 
    tobinharris.com
    Leeds, UK
    Co-author of NHibernate in Action
    Likes iPhone, iPad, HTML5, .NET and Ruby on Rails

    Developer and Founder at engineroomapps.com

  5. #5
    Ext User
    Join Date
    Jul 2010
    Location
    Calgary, Alberta
    Posts
    186
    Vote Rating
    1
    nosarious is on a distinguished road

      0  

    Default


    All of the examples have 'event handlers' and 'listeners'. Could someone please indicate where I could put this?

    uhm... politely? I know the most logical answer to that question.

Similar Threads

  1. [FIXED-22] doubletap event on Dataview isn't called (0.82)
    By rdougan in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 14 Aug 2010, 7:10 AM
  2. TAP PANEL MULTIPLE FORMS MULTICOLUN
    By jalberghini in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 10 Oct 2008, 11:11 AM
  3. getting onBrowserEvent called?
    By mindstream in forum Community Discussion
    Replies: 2
    Last Post: 10 Sep 2008, 2:35 PM
  4. why methods are not getting called?
    By blancomario in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 4 Aug 2008, 11:48 AM

Thread Participants: 4