diff options
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/jqTree/_entries/22_oncanmoveto.md')
-rw-r--r-- | ecomp-portal-FE/client/bower_components/jqTree/_entries/22_oncanmoveto.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ecomp-portal-FE/client/bower_components/jqTree/_entries/22_oncanmoveto.md b/ecomp-portal-FE/client/bower_components/jqTree/_entries/22_oncanmoveto.md new file mode 100644 index 00000000..abd68c1e --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/jqTree/_entries/22_oncanmoveto.md @@ -0,0 +1,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 %} |