Tree copy items with drag-and-drop taking time more and more depends on items

Dear All,

I am facing one issue at the tree which is copy items with drag-and-drop taking time. It depends on the number of items. Below link is a recorded video for reference. It is taking 5 seconds for 31 items to copy drag-and-drop.
I am using the below code in my project for copy items with drag-and-drop.

May I have the advice to solve the taking time issue?

var details = {
parent: context.target
};
if (target.type == “element”) {
var parentId = $$(“tree_itemGroupBrowser”).getParentId(target.id);
branchName = $$(“tree_itemGroupBrowser”).data.getBranch(parentId).map(function(x) {
if (x.externalId == undefined) {
return x.value;
} else {
return x.value + x.externalId;
}
});
details = {
parent: parentId
};
}
if (target.type == “rootfolder” || target.type == “groupfolder”) {
// $$(“tree_itemGroupBrowser”).close(target.id);
return false;
}
//console.log(context.source[0].type);
for (i = 0; i < context.source.length; i++) {
source1 = $$(“tree_elementBrowser”).getItem(context.source[i]);
if (source1.type == “category” || source1.type == “level” || source1.type == “typ” || source1.type == “material”) {
if (target.type == “category” || target.type == “level” || target.type == “typ” || target.type == “material” || target.type == “element”) {
continue;
}
}
var source1Name = source1.value;
if (source1.externalId != undefined) {
source1Name = source1Name + source1.externalId;
}
if (branchName.includes(source1Name)) {
continue;
}
context.from.copy(context.source[i], context.index, context.to, details);
var branchData = $$(“tree_itemGroupBrowser”).data.getBranch(context.source[i]);
if (branchData.length > 0) {
for (var dt of branchData) {
$$(“tree_itemGroupBrowser”).data.changeId(dt.id, webix.uid());
}
}
$$(“tree_itemGroupBrowser”).data.changeId(context.source[i], webix.uid());
}

Thanks,

May I have the solution for this?

Hello @NaingOo,

May I have the solution for this?

Unfortunately, I wasn’t able to reproduce the described issue using the provided code (e.g.: Code Snippet). Could you please provide an example where this issue can be seen (preferably, using our Snippet Tool)?