blob: abd68c1e4cd0c72160a984671fce0da5ce98ab73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
---
title: onCanMoveTo
name: options-oncanmoveto
---
You can override this function to determine if a node can be moved to a certain position.
{% highlight js %}
$('#tree1').tree({
data: data,
dragAndDrop: true,
onCanMoveTo: function(moved_node, target_node, position) {
if (target_node.is_menu) {
// Example: can move inside menu, not before or after
return (position == 'inside');
}
else {
return true;
}
}
});
{% endhighlight %}
|