Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ThianLiang, Cheow on Aug 10, 2009 00:09
open dhtmlx forum
Problem with enableMercyDrag

I get the following error in Firefox Error Console when trying to use drag and copy

"tree is not defined"
these is the code highlighted by Firefox

if (Nodes[i]==zParent){flag=Nodes[i];Nodes[i]=Nodes[Count]}}};dhtmlXTreeObject.prototype._recreateBranch=function(itemObject,targetObject,beforeNode,level){var i;var st="";if (beforeNode){for (i=0;i<targetObject.childsCount;i++)if (targetObject.childNodes[i]==beforeNode)break;if (i!=0)beforeNode=targetObject.childNodes[i-1];else{st="TOP";beforeNode=""}};var t2=this._onradh;this._onradh=null;var newNode=this._attachChildNode(targetObject,itemObject.id,itemObject.label,0,itemObject.images[0],itemObject.images[1],itemObject.images[2],st,0,beforeNode);newNode._userdatalist=itemObject._userdatalist;newNode.userData=itemObject.userData.clone();newNode.XMLload=itemObject.XMLload;if (t2){this._onradh=t2;this._onradh(newNode.id)};if (itemObject.treeNod.dpcpy)tree._globalIdStorageFind(itemObject.id);else newNode.unParsed=itemObject.unParsed;this._correctPlus(newNode);for (var i=0;i<itemObject.childsCount;i++)this._recreateBranch(itemObject.childNodes[i],newNode,0,1);if ((!level)&&(this.childCalc)) {this._redrawFrom(this,targetObject)};return newNode};dhtmlXTreeObject.prototype._moveNodeTo=function(itemObject,targetObject,beforeNode){if (itemObject.treeNod._nonTrivialNode)return itemObject.treeNod._nonTrivialNode(this,targetObject,beforeNode,itemObject);if (targetObject.mytype)var framesMove=(itemObject.treeNod.lWin!=targetObject.lWin);else

Below is my code
tree1 = new dhtmlXTreeObject("tvCompanyTree", "248px", "200px", 0);
tree1.setImagePath("../../Component/dhtmlx/dhtmlxTree/codebase/imgs/");
tree1.enableMercyDrag(true);
tree1.enableTreeImages(false);
tree1.enableTreeLines(true);
tree1.enableDragAndDrop(true);
tree1.loadJSONObject(result);
tree1.openAllItems(0);

but when I change the variable name from tree1 to tree, no such error occurs.

Please help.


Regards,
Thian Liang
Answer posted by Alex (support) on Aug 10, 2009 03:27

Hello, 

the mentioned feature was fixed. Please, contact us at support@dhtmlx.com, provide your ref.number and we'll send you the fix