Results 1 to 4 of 4

Thread: Carousel - Switch on/off swipe listener

  1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    111
    Answers
    5

    Default Carousel - Switch on/off swipe listener

    Is there a way to turn off and on the swiping between panels on a carousel object after it has been instantiated? I've looked through all the methods with no luck. setDraggable and setScrollable looked like they could be right, but they're not.

    Thanks!

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451
    Answers
    3997

    Default

    Could just remove the listeners on the element:

    Code:
    Ext.define('Ux.carousel.Carousel', {
        extend : 'Ext.carousel.Carousel',
        alias  : 'ux-carousel',
    
        toggleSwipe : function(allow) {
            this.element[allow ? 'on' : 'un']({
                dragstart : 'onDragStart',
                drag      : 'onDrag',
                dragend   : 'onDragEnd',
                scope     : this
            });
        }
    });
    This gives you a toggleSwipe method that if you pass true in it will add the listeners allowing swipe navigation, if you pass false it will disable the listeners and not allow swipe navigation (typed from my head)
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3

    Default Draggable in content of cards

    I have some cards that have draggable functionality. So I want to turn on and off the swipe listener on the carousel. However, using this method still catches the drag/dragstart/dragend events from the carousel. I want the carousel to ignore those events so those events are captured by the card contents. Is this possible?

  4. #4
    Sencha User
    Join Date
    Sep 2015
    Posts
    1

    Default

    Hi, i want to swipe between panels on a carousel object after certain validations in a form placed in an outer container. how can i achieve that?

    Thanks!

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
  •