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

if(this.target.getLevel()>3 && this.where=='inside'){
    this.where='notAllowed';
}

2

Thank you very much Moro, generally this works but not everytime.

1. Main menu
   1.1
   1.2

I could put menu 1.2 into menu 1.1:

1. Main menu
   1.1
      1.2
2. Main menu 2
...

This is OK. But I can't sort on this level (something like this):

before:
1. Main menu
   1.1
      1.1.2
      1.1.3
after
1. Main menu
   1.1
      1.1.3
      1.1.2

3

Mif.Tree.Node.implement({
    
    getLevel: function(){
        var level=0;
        var node=this;
        while(node){
            node=node.getParent();
            level++;
        }
        return level;
    }
    
});

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

4

Hi,

I must implement some blocking of drag'n' drop to some level, Let's say that I want to menu with max 3 level:

1. Main menu
   1.1
   1.2
      1.2.1
2. Main menu 2
   2.1
   2.2
and so on


so, there must be some way to block moving i.e. 2.2 to menu 1.2.1.1 for example:

1. Main menu
   1.1
   1.2
      1.2.1
         1.2.1.1 <- bad

Can anyone help me with this?

Thanks and regards
Paul