Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    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 Tap, doubletap & taphold on one component

    Tap, doubletap & taphold on one component


    Hi folks

    I want to handle tap, doubletap and taphold separately for a single component, is there a code sample anywhere, I've not been able to nail it!

    Tobin
    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

  2. #2
    Sencha - Community Support Team
    Join Date
    Jun 2010
    Posts
    220
    Vote Rating
    0
    meyerovb is on a distinguished road

      0  

    Default


    You can attach multiple events like those interactive ones to the component's element once it has been added to the page (or rendered, not sure, as it's not well documented yet). See my question asking for examples for a current method for attaching them (just add more listeners) http://www.sencha.com/forum/showthre...ing-dom-events

  3. #3
    Sencha - Community Support Team
    Join Date
    Jun 2010
    Posts
    220
    Vote Rating
    0
    meyerovb is on a distinguished road

      0  

    Default


    Search this forum for my post with subject: Inline method for attaching dom events
    Has an example that currently works, but you need to wait for the element to be added/rendered/instantiated (not sure which yet)

  4. #4
    Sencha - Community Support Team
    Join Date
    Jun 2010
    Posts
    220
    Vote Rating
    0
    meyerovb is on a distinguished road

      0  

    Default


    They really need to stop monitoring posts that include hyperlinks to other posts...

    http://www.sencha.com/forum/showthread.php?105114

    Especially seeing that you can just edit a post to include it

  5. #5
    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


    Thanks guys.

    My bad, I phrased my question wrong :S

    I'm really interested in how you tell the difference between which event was raised, "tap" seems to always get called. I tried a couple of tricks, and inspecting the dom, but couldn't find a clean solution.

    I also saw another post that said, "just do it the way you would normally". Anyone know what the regular approach to this is?

    Tobin
    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

  6. #6
    Sencha - Community Support Team
    Join Date
    Jun 2010
    Posts
    220
    Vote Rating
    0
    meyerovb is on a distinguished road

      0  

    Default


    Tab gets fired before doubletap (and probably taphold as well) just as click gets fired before doubleclick. Most of the other events like slide and pinch are based of base events like tap if you look in the event manager.

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

      1  

    Default


    Thanks for the reply. I was really interested in setting up and handling both doubletap and tap on one component, without them interfering with each other! The problem is that tap always gets called first, do how do you know it's a double tap?

    Anyway, this seems to work well (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);  
                    
                    
    //invoke (with reasonable time to cancel)
                    
    this.delayedTask.delay(300);
                }                
            }, 
            
    doubletap: function(e){                
                
    //cancel and clear the queued single click tasks if it's there
                
    if(this.delayedTask != null){
                  
    this.delayedTask.cancel();
                  
    this.delayedTask null;
                }                        
                
                
    //handle the double click
                
    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

  8. #8
    Sencha - Community Support Team
    Join Date
    Jun 2010
    Posts
    220
    Vote Rating
    0
    meyerovb is on a distinguished road

      0  

    Default


    Yep, that's pretty much the universal single/double method... the millisecond time is tweaked by your design dept, then you move on

  9. #9
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    162
    Vote Rating
    0
    stefx is on a distinguished road

      0  

    Default


    sorry but I don't understand where put this code.
    I've a list.. How to manage this events?

    thanks a lot
    Stefano

  10. #10
    Sencha User
    Join Date
    Jul 2013
    Posts
    2
    Vote Rating
    0
    JordiMundo is on a distinguished road

      0  

    Default


    Hey, I found a way with no delay if anyone is still tooking after it...if I apply singletap, taphold and touchend there is a combination to do which allow each event to happen with no delay and attach different functionality to them...
    Code:
    taphold: function(ev,el){
        function(){//do your things}; 
        this.longpressed = true; 
        window.setTimeout(function(scope){
            scope.longpressed = false;
            scope.isTouchended = false; 
        }, 500, this)
    }, 
    singletap: function(ev,el){ 
        if(this.isTouchended){                                        
            this.isTouchended = false;                                        
            function(){//do your things};                                     
        }                                   
    },                                
    touchend: function(){                                  
        if(!this.longpressed){                                        
             this.isTouchended = true;
        }
    }

Similar Threads

  1. Tap to show Toolbar
    By dazex in forum Sencha Touch 1.x: Discussion
    Replies: 6
    Last Post: 7 Mar 2011, 11:35 PM
  2. Replies: 3
    Last Post: 8 Sep 2010, 4:13 PM
  3. [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
  4. With the doubletap, will tap always be called, or is that a bug?
    By rdougan in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 6 Aug 2010, 9:55 PM
  5. TAP PANEL MULTIPLE FORMS MULTICOLUN
    By jalberghini in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 10 Oct 2008, 11:11 AM

Thread Participants: 3