Topic: copy tree node without ctrl key
hello everybody,
I have two trees, and I would like to always copy a node from one tree to the other one.
is it possible? how can I do it?
thanks a lot,
claudette.
You are not logged in. Please login or register.
Pages 1
hello everybody,
I have two trees, and I would like to always copy a node from one tree to the other one.
is it possible? how can I do it?
thanks a lot,
claudette.
u can add action:'copy' and u will always copy nodes instead moving:
tree = new Mif.Tree({
container: $('tree_container'),
initialize: function(){
new Mif.Tree.KeyNav(this);
new Mif.Tree.Drag(this, {
action:'copy',
...
})
}
...thank you moro for your quick response!
but I only have to copy when I'm dragging from one tree to another, not within a tree. How do I know from which tree the current dragged node is?
thanks in advance!
claudette.
try implement custom action. You can use this code as prototype (here idea, not a real example):
...
new Mif.Tree.Drag(this, {
action:'dndCustomAction',
...
});
...
Mif.Tree.implement({
dndCustomAction: function(current, target, where){
if(current.tree==target.tree){
current.tree.move(current, target, where);
}else{
current.tree.copy(current, target, where);
}
}
});Posts [ 5 ]
Pages 1
Powered by PunBB