Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Robin on Oct 23, 2008 07:13
open dhtmlx forum
Is it possible to drag node from Tree to treegrid?

Is it possible to drag node from Tree to treegrid? If Yes, please send me the sample.

I am using v.1.5 and wont be able to upgrade the version.

Thanks

Robin
Answer posted by Support on Oct 23, 2008 07:58
Yes it possible to drag items from tree to treegrid and back , just enable drag-and-drop on both components. This will be enough, you need not to use any additional commands
Answer posted by Robin on Oct 23, 2008 08:19

An error which says "Object doesnt support method or property"

below is the code I am using, please let me know whats wrong it it? Or am I using old version code here :(

<img id="aDhtmlxImg" src="dhtmlx/imgs/" style="display:none;"></img>

 <div id="gridbox3" width="100%" height="245px" style="background-color:white;overflow:hidden;border :1px solid silver"></div>
 
 <script  src="dhtmlx/dhtmlxcommon.js"></script>
 <script  src="dhtmlx/dhtmlxgrid.js"></script>  
 <script  src="dhtmlx/dhtmlxgridcell.js"></script> 
 <script  src="dhtmlx/dhtmlxtreegrid.js"></script>
 <script  src="dhtmlx/ext/dhtmlxgrid_start.js"></script>
 <script  src="dhtmlx/ext/dhtmlxgrid_hmenu.js"></script>
 <script  src="dhtmlx/ext/dhtmlxtreegrid_lines.js"></script>
 <script  src="dhtmlx/ext/dhtmlxgrid_nxml.js"></script>
 <script  src="dhtmlx/ext/dhtmlxgrid_pgn.js"></script>
 
 <script language="JavaScript" src="dhtmlx/dhtmlxprotobar.js"></script>
 <script language="JavaScript" src="dhtmlx/dhtmlxtoolbar.js"></script>
 
 <link rel="STYLESHEET" type="text/css" href="dhtmlx/dhtmlxgrid.css">
 <link rel="STYLESHEET" type="text/css" href="dhtmlx/dhtmlxgrid_skins.css">
 <link rel="STYLESHEET" type="text/css" href="dhtmlx/dhtmlxtoolbar.css">
 
 <script>
 
  mygrid = new dhtmlXGridObject('gridbox3');
  //mygrid.selMultiRows = false;
  mygrid.imgURL = document.getElementById("aDhtmlxImg").src;
  mygrid.setHeader("&nbsp;,&nbsp;,Name,Version,Status,Author,Modified By,Modified On,Hidden");
     mygrid.setInitWidths("25,25,230,65,65,110,110,125,0");
     mygrid.setColAlign("left,left,left,left,left,left,left,left,left");
     mygrid.setColTypes("ro,ro,tree,ro,ro,ro,ro,ro,ro");
     //mygrid.setColSorting("str,str,str,str,str,str,str,str,str");
    // mygrid.attachEvent("onBeforeSelect",beforeRowSelected);
    // mygrid.attachEvent("onRowSelect",doOnRowSelected);
    mygrid.enableMercyDrag(true);
    mygrid.enableDragAndDrop(true);
   //  mygrid.enableTreeCellEdit(false);
     mygrid.init();
 </script>

Answer posted by Support on Oct 23, 2008 08:35
Probably dhtmlxgrid_drag.js is missed...