PDA

View Full Version : Drag and drop data between child and the parent window



ev_irtt
14 Jun 2010, 1:44 AM
I have a child window which has a grid A. The values in the grid A needs to be dragged in to the parent window grid B. I can able to drag data in child window using below code



var grid = new Ext.Panel({
renderTo: 'main',
id: 'dplMainPanel',
title: 'Users',
iconCls: 'formIcon',
items:[{
xtype: 'editorgrid',
id: 'dplGrid',
store: store,
cm: columns,
width: 400,
height: 410,
frame: true,
clicksToEdit: 1,
listeners: {
render: function(){
initializeDragZone(this);
}
}
}]
});

function initializeDragZone(v) {
v.dragZone = new Ext.dd.DragZone(v.getEl(), {
getDragData: function(e) {
var sourceEl = e.getTarget(v.itemSelector, 10);
if (sourceEl) {
d = sourceEl.cloneNode(true);
d.id = Ext.id();
return v.dragData = {
sourceEl: sourceEl,:
repairXY: Ext.fly(sourceEl).getXY(),
ddel: d,
fieldData: v.getRecord(sourceEl).data
}
}
},
getRepairXY: function() {
return this.dragData.repairXY;
}
});
}


And have interaction with the parent window as below



var pExt = opener.Ext;
var pBody = opener.document.body;
var ddm = Ext.dd.DragDropMgr;
pExt.EventManager.on(pBody, 'mousemove',ddMouseMove, ddm, true);
pExt.EventManager.on(pBody, 'mouseup',ddMouseUp, ddm, true);


I dont know how to make drag element to fly inside parent window on mouse move (means inside ddMouseMove function) and to drop the element value in to the grid in parent window on mouse up (means inside ddMouseUp function).

Please some one help me.

Thanks a Ton in advance,
Venky.

ev_irtt
14 Jun 2010, 5:32 AM
Please some one suggest me on how to achieve drag and drop between window and the pop up wndow

Sachin_kulkarni
14 Jun 2010, 5:49 AM
Hi,

I am trying to implement drag and drop from parent to child iframe. I am able to drop the items on a div if the iframe is removed. But the "notifyDrop()" is not called when I introduce the iframe into the div. Very few information is available on this on the internet, can anybody suggest me how to implement this?

Thanks.

ev_irtt
14 Jun 2010, 6:25 AM
Can you share your code??

Sachin_kulkarni
14 Jun 2010, 6:32 AM
I followed the site :
http://examples.extjs.eu/ Example: Drag from tree to div

But in the drop-target div, I have some other page embeded using <iframe>, which is creating the problem.
Any suggestion is welcome.

Thanks.