Categories | Question details Back To List | ||
Drag and Drop from Grid to Tree Something has broken in your latest code. I am dragging a row from a Grid to a Tree. I can confirm that each row has valid XML and a valid RowID. On my tree, I have the following: var eventID = attachEvent("onDrag", MyTree_Drag); function MyTree_Drag(sourceID, targetID, insertNodeID, sourceTreeObj, targetTreeObj) { : : } When I stick a breakpoint in MyTree_Drag, when looking at the sourceID, it contains "". In previous versions of Tree and Grid, I definitely had this working and sourceID contained the RowID of the dragged row in the grid. I did post something a month ago whereby if Row 1 was selected and I dragged Row 2, the drag routine was incorrectly placing the RowID for Row 1 in the sourceID. I specifically requested that I wanted the sourceID for the "dragged" row - not the selected row. Somewhere, somehow, the fix has gone wrong. Because I now get nothing in the sourceID. Please advise. Answer posted by Stanislav on Nov 26, 2007 03:33 I suppose by var eventID = attachEvent("onDrag", MyTree_Drag); you mean var eventID = tree.attachEvent("onDrag", MyTree_Drag); rigth? Unfortunately problem can't be reconstructed with local samples, with latest code I always got correct ID ( the problem was exist for sure, for some older builds, but all latest versions, mustn't have such problem ) If problem still occurs for you - please contact us directly at support@dhtmlx.com - I will provide latest version of _drag extension , if problem will occur even for it - I will need any kind of sample where problem can be reconstructed. Answer posted by Nick Armitage on Nov 26, 2007 04:57 To answer the first bit - yes. I have the following: var x = new dhtmlXTreeObject("my_tree","100%","100%",0); with (x) { ... } So when I copied my code, it appears that the "tree." is missing but it isn't really. Unless this is the issue - ie I shouldn't be using "with (x)"??? I can't believe so as it's always been working in the past. For the actual problem, I took the latest (Standard Edition) dhtmlxTree.js file from the website. Is it possible that the issue is that I am using an older version of dhtmlxTree_dragIn.js and the two different versions do not work together? I'm not sure if this is the case so will try at home and report back. When downloading the latest zip file, there isn't a dhtmlxTree_dragIn.js file any more??? Also, because I am dragging a row from a Grid to a node in a Tree, do the versions of the Grid and Tree need to be in step? In other words, has dhtmlxCommon.js changed and it might be that I'm using an old version? In the latest zip for instance, only _ed, _er and _start of the dhtmlxTree_???.js files are included. Actually I have noticed that the dhtmlxTree.zip file now contains different files than previously. For instance, all I see in the sources directory is dhtmlxCommon.js and dhtmlxTree.js I have various other files dhtmlxTree_bc.js, dhtmlxTree_dragIn.js, dhtmlxTree_ed.js Are these files still needed or are they extra files that add extra functionality? I see the ext directory but that only contains _ed, _er and _start .js files Where is the _dragIn.js file? What is the _bc.js file? Does the folder structure need to remain in place? In other words the ext folder needs to be one level down from the main js code? Or can they all be put in the same folder? I think I've just put them all in the same "js" folder underneath dhtmlxTree. As I said, it was all working previously... Answer posted on Nov 26, 2007 06:59 >>Unless this is the issue - ie I shouldn't be using "with (x)"??? It must not be a problem. >>there isn't a dhtmlxTree_dragIn.js file any more??? It was our mistake, file will be restored in standard package in nearest time, sorry for inconvenience. If you are using only this file there must not be any conflict >>Also, because I am dragging a row from a Grid to a node in a Tree, do the versions of the Grid and Tree need to be in step? Not necessary, main functionality must work for any version of grid and tree, but the combination of different version can produce some unexpected problems. More safe strategy - use latest version from both branches. >>In other words, has dhtmlxCommon.js changed and it might be that I'm using an old version? dhtmlxCommon.js can be always taken from latest version, it is fully backward compatible, so can't be a reson of any problem (more than that, there was no changes in core for last few versions ) >>I have various other files dhtmlxTree_bc.js, dhtmlxTree_dragIn.js, dhtmlxTree_ed.js >>Are these files still needed or are they extra files that add extra functionality? Actually, for tree you need only two files - dhtmlxtree.js and dhtmlxcommon.js dhtmlxtree_bc.js - was necessary for backward compatibility with dhtmlxtree 1.0 and dhtmlxtree applet, droped now dhtmlxtree_ed.js - was missed in package ( latest version of dhtmlxtree package at dhtmlx.com ) already must contain it - necessary only if you plan to use live edit functionality. dhtmlxtree_dragin.js - contains wrappers for simplification of custom drag-n-drop , not necessary for default d-n-d in dhtmlxtree >>Does the folder structure need to remain in place? Current version of package contains file with both old and new naming , starting from new version it will contain only files with new naming ( pro version of tree contains 11 extensions - so it has sense to separate necessary and optional files ) >>In other words the ext folder needs to be one level down from the main js code? Actually it has no difference, necessary files need to be included on page manually, so it just for logical separation. |