scheduler.attachEvent("onExternalDragIn", function(id, source, e){
var tree_item_id = tree._dragged[0].id; // getting tree item id
scheduler._dragged_tree_item = tree_item_id; // setting custom flag with tree item id when item was dragged in
var label = tree.getItemText(tree_item_id);
var ev = scheduler.getEvent(id);
ev.text = label;
return true;
});
scheduler.attachEvent("onEventSave", function(id, data, is_new_event) {
if(scheduler._dragged_tree_item)
tree.deleteItem(scheduler._dragged_tree_item); // if flag is set then event was created using dnd and we need to delete item from the tree
return true;
});
scheduler.attachEvent("onAfterLightbox", function () {
scheduler._dragged_tree_item = false; // resetting flag after lightbox was closed
});
I don’t really get what you mean. The item is already in the tree, but instead of deleting it, I would like to move it to another node (which also exists).
Hello, I am also trying to remove an item from the tree. I tried copying and pasting your code without success. It seems like onEventSave isn’t working for me. I even tried: