PDA

View Full Version : Drag from Grid Row to form



lukefowell89
9 Nov 2010, 6:34 AM
Hi,

I am currently trying to drag data from a GridPanel I have created, and putting the data across to a form to be able to edit that data, then load the form and save it to a database.

All of which works except I cannot get the row to drag into my DropTarget. It doesnt acknowledge I am dragging anything!

I have enableDragDrop: true on my grid, and have set a ddGroup, and then I have added this code to be able to handle it.


var editFormTargetEl = editForm.body.dom;
var editFormDropTarget = new Ext.dd.DropTarget(editFormTargetEl, {
ddGroup: 'gridDDgroup',
notifyEnter: function(source, event, data){
editForm.body.stopFx();
editForm.body.highlight();
alert('hi');
},
notifyDrop : function(source, event, data){
var selectedRecord = source.dragData.selections[0];
editPanel.getForm().loadRecord(selectedRecord);
return(true);
}
});
Where am I going wrong??