drag and drop from grid to tree

I have a grid and a tree in one jsp page, now I want to use drag and drop item form grid to tree just for reading the grid id and target node id so I can move the dragged item into the group with target id by ajax code in my database after that I want to refresh grid again for deleting the item.



So I don’t need to remove grid or add any new node to tree by dhtmlx!



this is my code:



tree.attachEvent(“onDrop”,function(source_id,target_id,bef_id,source_object,target_object){



if(source_object == grid){

alert(target_id);// just for test

}

return false;

})





tree.attachEvent(“onDragIn”,function(sid,tid){

if(tid == “locked_id”) return false

return true

})



grid.attachEvent(“onDragIn”,function(sid,tid,sobj,tobj){

if(tobj == grid) return false

return true

})



but after drop dragged item on the tree firebug give me this error:



itemObject.parentObject is undefined

_recreateBranch()(tr.odd_light, Object htmlNode=table tr=tr childsCount=0 tempDOMM=0, undefined)dhtmlxtree.js (line 106)

_recreateBranch()(tr.odd_light, Object htmlNode=table tr=tr childsCount=0 tempDOMM=0)dhtmlxtree.js (line 103)

_dragIn()(td, Object entBox=div#empgridbox.gridbox _wcorr=0 _f2kE=true, td.standartTreeRow)dhtmlxtree.js (line 150)

stopDrag()(mouseup clientX=1208, clientY=97, undefined)dhtmlxcommon.js (line 50)

[Break on this error] {targetObject.XMLload=1;this._loadDynXM…ee.dpcpy)oldTree.deleteItem(_otiid)}else



I really need to give me help please…



Thanks a lot…

Could you please prove us full example where we can reproduce this issue including files which you are using to initialize grid. (You can send it directly to the support@dhtmlx.com)