summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE/client/bower_components/jqTree/_entries/21_oncanmove.md
blob: ee19cf065253e3f476d8f3800bf0227a74fd102a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
title: onCanMove
name: options-oncanmove
---

You can override this function to determine if a node can be moved.

{% highlight js %}
$('#tree1').tree({
    data: data,
    dragAndDrop: true,
    onCanMove: function(node) {
        if (! node.parent.parent) {
            // Example: Cannot move root node
            return false;
        }
        else {
            return true;
        }
    }
});
{% endhighlight %}