You found a bug! We've classified it as TOUCH-2520 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    81
    Vote Rating
    0
    Omer Paran is on a distinguished road

      0  

    Default Setdraggable(false) on Panel moves the panel back

    Setdraggable(false) on Panel moves the panel back


    We start with a Panel and make it draggable. We move the panel around, when we call Setdraggable(false) at a certain point (certain point on the panel is clicked), the panel returns to the original location of the panel!

    A similar issue was with the Ext.JS, and there it is solved using drag proxies, but I don't see such support in Sencha touch

    this is a new problem in ST2, in ST1 it worked just fine

    thank you

    Omer.

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report. Draggable isn't as fleshed out as we would like it and we hope to enhance it going forward.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    81
    Vote Rating
    0
    Omer Paran is on a distinguished road

      0  

    Wink Work around for the described problem

    Work around for the described problem


    Reminder:

    Calling setDraggable(true) on a panel, dragging and then calling self.panel.setDraggable(false) sends the panel back to its original location

    Why we even need it?

    We have a panel (not full screen) with a Carousel in it. On a tablet, you can't set the the panel to draggable and use swipe on the Carousel, because it moves the panel instead.

    So - We set the panel as non draggable, but when the user holds the title bar (a toolbar) we set the panel to draggable and when the user leaves the toolbar we set it to non draggable

    In ST1 it worked fine, but in ST2, as noted above, it makes the panel jump back

    After many hours of trying to debug your code and fix or understand what is going on, I was able to find a workaround.

    When the user tap and holds on the toolbar we call:

    if(self.panel.getDraggable()) {
    self.panel.getDraggable().enable();
    }
    else {
    self.panel.setDraggable(true);
    }

    and when the user releases his finger from the toolbar , we call

    self.panel.getDraggable().disable();

Thread Participants: 1