islavi
May 29, 2013, 11:07am
#1
Hi,
I’m using the pro version 3.5
I’m trying to implement Copy|Cut and Paste.
The problem is that after the Paste command the tree is refreshed.
I saw in: [url]Multiselection
that the tree works without refresh.
Should I configure something in the tree to prevent the refresh?
tree=new dhtmlXTreeObject(“treeboxbox_tree”,“100%”,“100%”,0);
tree.setImagePath(“images/treeImgs/”);
tree.enableSmartXMLParsing(false);
tree.setOnClickHandler(showAttributes);
tree.enableDragAndDrop(inEditDeployRole == “false” ? false : true); tree.setDragHandler(tondrag);
tree.loadXMLString(o.responseText,function(){tree.loadOpenStates();});
Thanks
Darya
May 29, 2013, 12:31pm
#2
Hi
Could you specify, what do you mean in “refresh”? Back to “load” state?
islavi
May 29, 2013, 2:00pm
#3
Actually the problem is different.
When using the following: tree.setDragHandler(tondrag); with doCut | doPaste.
Activating doCut and then doPaste, the function tondrag (drag and drop handler) is called.
function tondrag(id,id2){
// Refresh the tree
}
it looks like the paste is calling the drag and drop handler.
Darya
May 29, 2013, 2:42pm
#4
Please, provide us your HTMLX file and tree structure
islavi
May 30, 2013, 8:20am
#5
Hi,
Thanks for your help,
I attached the file from your sample: 14_selection_sorting_navigation → 05_pro_multiselect.html and added the drag handler.
When trying “cut” and then “paste” you will see that the drag and drop handler is called.
myTest.zip (2.35 KB)
Darya
May 30, 2013, 11:03am
#6
To forse your paste behaviour worck correctly you need to return true in your handler:
function tondrag(id,id2){return true}
islavi
May 30, 2013, 11:17am
#7
I’m also using drag and drop, so currently the work around for me is to use global variable to save the state if paste was pressed or not, and in drag handler check the state of it.
Thanks
Darya
May 30, 2013, 11:51am
#8
So… We haven’t seen your dnd function, but locally everything works with your sent sample if return true in your custom sunction tondrag()