PDA

View Full Version : Disable Repair Animation



nclayton
31 Jul 2012, 6:52 AM
I am dragging items from a grid panel to a tree panel and would like for when an invalid drop is made, it would simply hide the "ghost", instead of moving it back to its starting location. I have tried placing object.dd.animRepair = false in several locations unsuccessfully.

Should I be setting this for the grid panel that I am dragging from, the tree panel I am dragging to, or both?
I was working with the beforedrop event of the tree panel, but it isn't being fired for invalid drops.

Any advice on how to get this disabled will be much appreciated!

mankz
31 Jul 2012, 10:39 AM
animRepair : false is the way to go according to sources.


repair : function(xy, callback, scope){
this.callback = callback;
this.scope = scope;
if (xy && this.animRepair !== false) {
this.el.addCls(Ext.baseCSSPrefix + 'dd-drag-repair');
this.el.hideUnders(true);
this.anim = this.el.animate({
duration: this.repairDuration || 500,
easing: 'ease-out',
to: {
x: xy[0],
y: xy[1]
},
stopAnimation: true,
callback: this.afterRepair,
scope: this
});
} else {
this.afterRepair();
}
},

Try setting a breakpoint to see exactly where your configs end up. Not entirely sure this is configurable in the case of grid DnD.

nclayton
2 Aug 2012, 7:45 AM
I'm having a hard time figuring out where to set the animRepair property to false.
My last attempt was in the itemmouseup event of the grid panel. Even with the property set to
false, the animation still fired.