Nestable2
Nestable2 copied to clipboard
How to prevent child node to dragged in another parent node
Thank you
prevent child to go parent and parent to go child, my guess is that you have just to play with parent id to get what you want on top
beforeDragStop: function(l,e, p){ // l is the main container // e is the element that was moved // p is the place where element was moved. m_element = $(e).data('type'); t_element = $(p).hasClass('nestable');
if(m_element == "child"){
if (t_element){
return false;
}else{
return true;
}
}else if (m_element == "root"){
if (t_element){
return true;
}else{
return false;
}
}
}