if(this.target.getLevel()>3 && this.where=='inside'){
this.where='notAllowed';
}All fields labelled (Required) must be completed before the form is submitted.
You are not logged in. Please login or register.
Mifjs forum — Mif.Tree, Mif.Menu » Help » Block drag'n'drop to specific level in tree » Post new reply
All fields labelled (Required) must be completed before the form is submitted.
if(this.target.getLevel()>3 && this.where=='inside'){
this.where='notAllowed';
}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
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';
}
}
...
});
...
},
...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
Mifjs forum — Mif.Tree, Mif.Menu » Help » Block drag'n'drop to specific level in tree » Post new reply
Powered by PunBB