arvindr21 / jsTree-directive

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

Fixing the attribute for contextmenu plugin. #24

Closed Jacquelin closed 9 years ago

Jacquelin commented 9 years ago

This allows the use of all settings (ie : select_node and show_at_node) The attribute tree-contextmenuaction becomes obsolete BUT users can use a Ojbect of Function on items (like in jsTree)

example :

<js-tree tree-plugins="contextmenu" tree-contextmenu="contextMenu" />
$scope.contextMenu = {
    items: {
      "Node": {
        "label" : "Node",
         "action" : function(obj) { 
          alert('node')
        }
      }
    }
  };

Here is a plunker (I reuse the same idea of #10 ) http://plnkr.co/edit/qr8vittbOwvRkNrtQyjz?p=preview

PS : I make this PullRequest to use select_node option. I would understand if it's not merged.

arvindr21 commented 9 years ago

This looks good. Thanks!

Jacquelin commented 9 years ago

Thanks to you !!

Just a question, should you not update the demo page ? Do you need help ?

arvindr21 commented 9 years ago

That will be helpful. You can update it here: https://github.com/arvindr21/jstree-angular-expressjs

Jacquelin commented 9 years ago

Done ;)