Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to prevent child node to dragged in another parent node #117

Open
bugfirstx opened this issue Feb 2, 2022 · 1 comment
Open

How to prevent child node to dragged in another parent node #117

bugfirstx opened this issue Feb 2, 2022 · 1 comment

Comments

@bugfirstx
Copy link

xZAfn (1)

Thank you

@b-cil
Copy link

b-cil commented Jul 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants