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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      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
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    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
  •