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

if I put the extension "dnd", how to make a non-movable element #60

Closed
thierrybrunel opened this issue Sep 19, 2013 · 1 comment
Closed
Milestone

Comments

@thierrybrunel
Copy link

if I put the extension "dnd", how to make a element no draggable,
tks

@mar10
Copy link
Owner

mar10 commented Sep 19, 2013

You can override

        onDragEnter: function(node, sourceNode) {
          /** sourceNode may be null for non-fancytree droppables.
           *  Return false to disallow dropping on node. In this case
           *  onDragOver and onDragLeave are not called.
           *  Return 'over', 'before, or 'after' to force a hitMode.
           *  Return ['before', 'after'] to restrict available hitModes.
           *  Any other return value will calc the hitMode from the cursor position.
           */
          // Prevent dropping a parent below another parent (only sort
          // nodes under the same parent)
/*           if(node.parent !== sourceNode.parent){
            return false;
          }
          // Don't allow dropping *over* a node (would create a child)
          return ["before", "after"];
*/
           return true;
        },

@mar10 mar10 closed this as completed Sep 19, 2013
@mar10 mar10 added this to the 2.0.0beta milestone May 11, 2014
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