View Full Version : GridRow as a DropTarget

15 Mar 2011, 4:20 AM
Im trying to get it work but i fail. I need to drop row from one grid onto another's grid row (i must have info on row dropped on).. Yet i found solution to do so, there are only tuts for haveing whole grid view as a droptarget witch is not what i need.

Pleas help me make it work. Any solution?

p.s. i managed to succeed with some DOM travestation but its not what i had in mind....

...on store load i create for each row a target:

for (i=0;i<rows.length;i++){
new Ext.dd.DropTarget(rows[i], {

....then i notifyDrop like :

notifyDrop : function(dd, e, gridData){
var row = Ext.get(this.el.id).dom;
var nodes = row.childNodes[0].childNodes[0].childNodes[0].childNodes;
if(nodes[j].childNodes[0].className == 'x-grid3-cell-inner x-grid3-col-1'){
alert(nodes[j].childNodes[0].innerHTML);// SIC!

....and all of this just to get row being dropped on value in column 1;

... please save me from this misery!

13 Jan 2014, 10:34 AM
I know this is old, but I had need for it and never found a solution on the forum. I did find it on some blog though:


Basically adding

targetRow = TargetGrid.getView().findRowIndex(e.target);
targetDataItem = TargetGrid.store.data.items[targetRow];

will get you the data of the row being dropped on.