arvindr21 / jsTree-directive

An Angular Directive for jsTree. Docs :
http://jstree-directive.herokuapp.com/
51 stars 33 forks source link

Add a function for customizing the context menu with the selected treenode #10

Closed sylvainmouquet closed 9 years ago

sylvainmouquet commented 9 years ago

Add a function for customizing the context menu with the selected treenode

example :

<js-tree tree-contextmenuaction="treeContextMenuAction" />

angularjs:

$scope.treeContextMenuAction = function ($node) {
                //alert('ok' + $node.type);
                return { 
                    "Delete": {
                        "label" : "Delete",
                        "action" : function(obj) { 
                            alert('delete')
                        }
                    }
                }
}
arvindr21 commented 9 years ago

Thanks for the contribution @revo22. Do you have a jsfiddle or codepen with this example?

sylvainmouquet commented 9 years ago

You could see an example here : http://jsfiddle.net/revo22/w3ds20c6/1/

arvindr21 commented 9 years ago

Perfect! Thanks @revo22