Results 1 to 3 of 3

Thread: Accessing default event swipe handler

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    26
    Answers
    1
    Vote Rating
    0
      0  

    Exclamation Answered: Accessing default event swipe handler

    Hi guys, I've got a carousel panel with html content loaded in, and I've set it up so on render, it has the el.on event of double tap
    e.el.on("doubletap",functionx(e){});
    Which works wonderfully, except that now the swipe is disabled for the panel. Any idea why or how to fix it so the doubletap stays in place but the default swipe events still apply?

    Any help is much appreciated!

    Cheers

  2. This is working for me without interrupting the swipe event of the carousel:

    Code:
    new Ext.Carousel({
        fullscreen : true,
        items      : [
            {
                html : 'Hi'
            },
            {
                html : 'Hello'
            }
        ],
        listeners : {
            afterrender: function(carousel) {
                carousel.el.on('doubletap', function() {
                    console.log('doubletap on carousel')
                });
    
                var items = carousel.query('panel');
    
                items[0].el.on('doubletap', function() {
                    console.log('doubletap on first')
                });
    
                items[1].el.on('doubletap', function() {
                    console.log('doubletap on second')
                });
            }
        }
    });

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    This is working for me without interrupting the swipe event of the carousel:

    Code:
    new Ext.Carousel({
        fullscreen : true,
        items      : [
            {
                html : 'Hi'
            },
            {
                html : 'Hello'
            }
        ],
        listeners : {
            afterrender: function(carousel) {
                carousel.el.on('doubletap', function() {
                    console.log('doubletap on carousel')
                });
    
                var items = carousel.query('panel');
    
                items[0].el.on('doubletap', function() {
                    console.log('doubletap on first')
                });
    
                items[1].el.on('doubletap', function() {
                    console.log('doubletap on second')
                });
            }
        }
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    26
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    This is working for me without interrupting the swipe event of the carousel:

    Code:
    new Ext.Carousel({
        fullscreen : true,
        items      : [
            {
                html : 'Hi'
            },
            {
                html : 'Hello'
            }
        ],
        listeners : {
            afterrender: function(carousel) {
                carousel.el.on('doubletap', function() {
                    console.log('doubletap on carousel')
                });
    
                var items = carousel.query('panel');
    
                items[0].el.on('doubletap', function() {
                    console.log('doubletap on first')
                });
    
                items[1].el.on('doubletap', function() {
                    console.log('doubletap on second')
                });
            }
        }
    });
    Much appreciated! All sorted now. Not sure exactly why, but placing the double tap event on the panel within the carousel conflicted, so I took that back out onto the carousel and it still worked perfectly and didn't override the swiping!

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
  •