Sencha Touch 2.x Forums /
Sencha Touch 2.x: Bugs /
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 for the report. Draggable isn't as fleshed out as we would like it and we hope to enhance it going forward.
Work around for the described problem
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:
and when the user releases his finger from the toolbar , we call