Skip to forum content
Mif
— mystic javascript interface
You are not logged in. Please login or register.
Active topics Unanswered topics
Post new reply
Post new reply
Compose and post your new reply
You may use: BBCode Images Smilies
All fields labelled (Required) must be completed before the form is submitted.
Topic review (newest first)
node.dropDenied.include('inside') means that you can't drop inside, but can before or after.
If forest:false by default you can't drop before and after root node.
In your situation with forest:true, realy need node.dropDenied.combine(['before','after','inside'])
Thank you very very much!
Only the last post is right for me (I have forest: true) with commented line:
tree.addEvent('load', function(){
tree.root.getChildren().each(function(node){
node.dropDenied.combine(['before','after','inside'])
});
});
The line: node.dropDenied.include('inside'); don't work.
Thanks a lot again.
Paul
and be sure, that root node exists. If you have forest: true, root node not exist(hidden) and you should do something like:
tree.addEvent('load', function(){
tree.root.getChildren().each(function(node){
node.dropDenied.include('inside');
//or
//node.dropDenied.combine(['before','after','inside'])
//or what you want
});
});
or use it in json:
[{
"property": {
"name": "root",
"dragDisabled": true,
"dropDenied": ["inside", "before", "after"]
},
"children": [
{
"property": {
"name": "node1"
}
}
]
}]
tree.addEvent('load', function(){
...
})
Unfortunetally both doesn't work:(, in the second example firebug shows that
tree.root is undefined
in the line you wrote.
I put this line of code once before, and once after line
tree.load({...}), do you have any other idea? I could put here my code if you want
or
tree.root.dropDenied.include('inside');
try something like:
new Mif.Tree.Drag(this, {
onDrag: function(){
if(this.target == this.tree.root){
this.where='notAllowed';
}
}
});
Helo,
Earlier i wrote that I need to block dragging root node, it works great, but how to do that user cannot put some "non-root" nodes into root position? Now when I put some child node into root position, it became non-dragged so, it must be some way to disable dropping into root. Could you help me with this?
Thank you
Regards
Paul