PDA

View Full Version : [OPEN-1341] Ext.dd.DragSource with ddGroup defined



extuser007
18 Oct 2010, 5:28 AM
When i register more than one Ext.dd.DropTarget with different ddGroups 'ddGroup-1' and 'ddGroup-2' for one component, and one Ext.dd.DragSource with 'ddGroup-1' for another component. Then DD operation fail's because Ext.dd.DropTarget with 'ddGroup-2' handle drop operation.

As i understand from docs, expected that Ext.dd.DropTarget with 'ddGroup-1' must handle operation.

ddGroup : String
A named drag drop group to which this object belongs. If a group is specified, then this object will only interact with other drag drop objects in the same group (defaults to undefined).


Here my workaround:


Ext.override(Ext.dd.DragSource, {
// private
onDragEnter : function(e, id){
//var target = Ext.dd.DragDropMgr.getDDById(id);
var target = (this.ddGroup)
? Ext.dd.DragDropMgr.ids[this.ddGroup][id]
: Ext.dd.DragDropMgr.getDDById(id);
this.cachedTarget = target;
if(this.beforeDragEnter(target, e, id) !== false){
if(target.isNotifyTarget){
var status = target.notifyEnter(this, e, this.dragData);
this.proxy.setStatus(status);
}else{
this.proxy.setStatus(this.dropAllowed);
}

if(this.afterDragEnter){
/**
* An empty function by default, but provided so that you can perform a custom action
* when the dragged item enters the drop target by providing an implementation.
* @param {Ext.dd.DragDrop} target The drop target
* @param {Event} e The event object
* @param {String} id The id of the dragged element
* @method afterDragEnter
*/
this.afterDragEnter(target, e, id);
}
}
}
});