Cut / Paste refresh the tree

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

Hi
Could you specify, what do you mean in “refresh”? Back to “load” state?

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.

Please, provide us your HTMLX file and tree structure

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)

To forse your paste behaviour worck correctly you need to return true in your handler:
function tondrag(id,id2){return true}

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

So… We haven’t seen your dnd function, but locally everything works with your sent sample if return true in your custom sunction tondrag()