PDA

View Full Version : [B3] Ext.grid.plugin.DragDrop beforedrop event



elasticsystems
19 Apr 2011, 9:50 AM
I have a pair of grids with the DragDrop plugin, which is working great except that I want to copy the record from the source grid, not move it (i.e. I want the source record to remain in the source grid).

The only obvious way I could see to do this is to use the beforedrop event and return 0 as specified in the docs, however, although the beforedrop event is firing as expected, returning 0 has no effect.

(If there's a better way to copy a record rather than move it, I'd love to know, but either way this seems to be broken...)

Thanks!
Richard

elasticsystems
22 Apr 2011, 6:39 AM
Anyone else? Or just me? :)

aconran
22 Apr 2011, 1:59 PM
Can you create a small example for us to test out?

It looks like it should perform as documented... Take a look at Ext.view.DropZone onNodeDrop.

It gets the result of beforedrop and if its 0 immediately returns.

LB82
11 Aug 2011, 5:28 AM
It seems that this functionality is no longer available in 4.0.2 ?
I checked the

4.0.0 Ext.view.DropZone

if (me.valid) {
performOperation = me.fireViewEvent('beforedrop', node, data, me.overRecord, me.currentPosition, processDrop);
if (performOperation === 0) {
return;
} else if (performOperation !== false) {
// If the processDrop function was called in the event handler, do not do it again.
if (!dropped) {
processDrop();
}
} else {
return false;
}
} else {
return false;
}

and the

4.0.2. Ext.view.DropZone

if (me.valid) {
performOperation = me.fireViewEvent('beforedrop', node, data, me.overRecord, me.currentPosition, processDrop);
if (performOperation !== false) {
// If the processDrop function was called in the event handler, do not do it again.
if (!dropped) {
processDrop();
}
}
}
return performOperation;
}


Is there another way to achieve the 4.0.0 behavoir?