Hi all,
So I'm adding some duplicate nodes on my tree like this:
So I get a copy of the node I inputed on the prompt.
Which means when I select one of the copies,all the node copies and the original are selected.
And if I change the dataItem attributes of one of the copies,all the dataItems are changed even though separate copies for each one of the copies is kept on the data Source.
I am ok with that,it's what I wanted.
The problem is that I want to delete one of the copies later,but If I try
all the copies and the original are deleted alltogether!
I also tried:
But on the first "ok" of a confirm, every node copy along with the original gets deleted again...not only the copy that I clicked ok for...
Is there a way I can delete only one of the copies based on it's parent?? (the copies will never have the same parent that's why I want to select which one to delete based on their parents)
So I'm adding some duplicate nodes on my tree like this:
var fatherNode_DataItem = treeview.dataItem(treeview.select());
var nodeText = prompt("Please enter desired Node Name to be copied:","default");
var dataItem_toBeCopied = treeview.dataItem(treeview.findByText(nodeText));
fatherNode_DataItem.append(dataItem_toBeCopied
);
So I get a copy of the node I inputed on the prompt.
Which means when I select one of the copies,all the node copies and the original are selected.
And if I change the dataItem attributes of one of the copies,all the dataItems are changed even though separate copies for each one of the copies is kept on the data Source.
I am ok with that,it's what I wanted.
The problem is that I want to delete one of the copies later,but If I try
var dataItem = treeview.dataItem(treeview.select());
treeview.remove(dataItem);
I also tried:
$("#treeview").find(".k-state-selected").each(function() {
if(confirm("Delete: " + $(this).text() + " with Father: " + treeview.text(treeview.parent($(this).closest(".k-item"))))) {
treeview.remove($(this).closest(".k-item"));
}
});
Is there a way I can delete only one of the copies based on it's parent?? (the copies will never have the same parent that's why I want to select which one to delete based on their parents)