Closed iGrog closed 10 years ago
@iGrog - you can use the beforeMove
callback to help with this scenario. If you set arg.cancelDrop
to true, then it will not actually move it. Then, you can create a clone and add it to the target list. Something like:
self.myDropCallback = function (arg) {
arg.targetParent.splice(arg.targetIndex, 0, new Task(arg.item.name()));
arg.cancelDrop = true;
};
Here is a sample: http://jsfiddle.net/rniemeyer/UcCTg/
Thank you, it helped.
Hm, but afterMove
does not fire on target list. How can I e.g. automatically save list after adding cloned item from source list?
@iGrog - the arg
passed to afterMove
has access to both the sourceParent
as well as the targetParent
, so you can perform operations on either in that callback.
How can I keep the original where its at (without re-appending it to the column) and have the clone move to the desired location?