Skip to content Skip to sidebar Skip to footer

Jstree Drag And Drop Restrict Folders By Class

How can you lock the drag function on a folder by class name class='locked'? And on the same time lock other folders to be draged into this folder class='locked'. I want a setup wh

Solution 1:

Found a way by using the CRRM plugin combined with core documentation for .get_move().

".o" is the node being moved, and ".r" is the reference node in the move.

http://www.jstree.com/documentation/core

http://www.jstree.com/documentation/crrm

Here is my code:

"crrm" : {
            "move" : {
                "default_position" : "first",
                "check_move" : function (m) {  
                    return (m.o.hasClass("locked") || m.r.hasClass("locked")) ? false : true;  
                }
            }
        }

Post a Comment for "Jstree Drag And Drop Restrict Folders By Class"