drag and drop any item

Hi,



I got your response dhtmlx.com/docs/products/kb/ … 183&a=1154



Could you provide more information? I’ve managed to cobble together the following, which seems to be somewhat correct (hilites happen, no errors) but the dragging still doesn’t occur.



testdrag




function init()

{

dropper=new dragFunc();

dragger=new dhtmlDragAndDropObject();



var item = document.getElementById(‘dragtester’);



dragger.addDraggableItem(item,dropper);



function dragFunc()

{

this._createDragNode=function(node)

{

var dragSpan=document.createElement(‘div’);

     dragSpan.style.position=“absolute”;

dragSpan.innerHTML="<img src=""+node.getAttribute(“src”)+"">";

dragSpan.style.zIndex=12;

};



this._drag=function(sourceHtmlObject,dhtmlObject,targetHtmlObject)

{

                 targetHtmlObject.style.backgroundColor="";

                 //targetHtmlObject.value=sourceHtmlObject.parentObject.label;



             }



             this._dragIn=function(htmlObject,shtmlObject)

             {

                 htmlObject.style.backgroundColor="#fffacd";

                 return htmlObject;

             }



            this._dragOut=function(htmlObject)

             {

                 htmlObject.style.backgroundColor="";

                 return this;

             }

}



}

Please check attached sample it uses code from your snippet.

Item in top frame registered as dragable, item in sub frame registered as drag landing.
The drag-controller object basically the same in both iframes
The real drag-n-drop logic described in _drag method of target controller.

common.zip (7.38 KB)