View Full Version : Disable Repair Animation

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!

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.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 {

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

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.

21 Apr 2016, 7:07 AM
What I am doing is always a "fake" drop. I just want to connect 2 grid records to a certain Ajax call. Therefor I want a fake drop that always fails, but comes later with a messagebox. But I don't want the animation back to its target.

I use a pluginId to find the plugin in the "beforedrop" event. This is a documented property.

viewConfig from the grid that is draggable:

viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
enableDrag: true,
dragGroup: 'ProduktionGrid', // I can drag to this group
dropGroup: 'ProduktionGrid', // I can drop in this group
pluginId: 'ProduktionGridDD'

this is in the drop grid:

viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
enableDrag: false, // I can't drag from here
dropGroup: 'ProduktionGrid', // I can drop from this group
listeners: {
scope: me,
beforedrop: function (node, data, overModel, dropPosition, dropHandlers, eOpts) {
// this is making the animation go away
data.view.getPlugin('ProduktionGridDD').dragZone.getProxy().animRepair = false;

if (overModel === null) return false;
var grid = data.view.up('gridpanel');
if (grid._gridModus === 'T') {
me.fireEvent('executefakedrop', grid, node, data, overModel);
return false; // drop niemals ausführen !!!