Skip to forum content

Mif

— mystic javascript interface

You are not logged in. Please login or register.


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.

Required information for guests



Captcha image. Turn pictures on to see it.
Required information
Optional post settings

Topic review (newest first)

1

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'])

2

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

3

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
   });
});

4

or use it in json:

[{
    "property": {
        "name": "root",
        "dragDisabled": true,
        "dropDenied": ["inside", "before", "after"]
    },
    "children": [
        {
            "property": {
                "name": "node1"
            }
        }
    ]
}]

5

tree.addEvent('load', function(){
    ...
})

6

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

7

or

tree.root.dropDenied.include('inside');

8

try something like:

new Mif.Tree.Drag(this, {
    onDrag: function(){
        if(this.target == this.tree.root){
            this.where='notAllowed';
        }
    }
});

9

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