I am implementing sortable/dorderable list functionality with Sencha Touch 2.0 . I am trying to replicate the functionality as it were in Sencha Touch 1.1 with Ext.util.Sortable class.
I am almost successful in getting the similar functionality with dragging around and with movement of other list items. However, in Sencha 1.1, there is a draggable.reset() functionality which mostly updates the boundaries as well as resets the offsets. I am unable to replicate this reset functionality with Sencha 2.0 draggable behavior.
Any ideas how to implement that? Following is the code in Sencha 1.1:
// We reset the draggable (initializes all the new start values)
draggable.reset();
// Move the draggable to its current location (since the transform is now
// different)
draggable.moveTo(region.left, region.top);
I changed moveTo() function with this:
draggable._element.setXY([region.left, region.top]);
But not the reset() functionality. I have tried to set the -webkit-transform directly to the draggable element but somehow that style isn’t getting added to that element. Any help?
Fixed the issue. The reset() function is no longer required – just changed the record index in the Dataview store and refreshed the dataview in “dragend” event.