سؤال

I have a tree with regular nodes and also some nodes that have Class1 added to them:

addClass: "custom1"

How can I prevent dropping on custom1 nodes and allow dropping on all other (regular) nodes?

هل كانت مفيدة؟

المحلول

Add a line to the onDrop handler to check the data.addClass of the target node:

onDrop: function(node, sourceNode, hitMode, ui, draggable) {
    if( node.data.addClass == 'custom1'){
        return;
    }

    // move the source
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top