title: Configuring jstree right-click contextmenu for different node types
body: <p>I've seen an example somewhere online showing how to customise the appearance of jstree's right-click context menu (using contextmenu plugin). </p>
  
  <p>For example, allow my users to delete "documents" but not "folders" (by hiding the "delete" option from the context menu for folders).</p>
  
  <p>Now I can't find that example. Can anyone point me in the right direction? The official <a href="http://www.jstree.com/documentation/contextmenu" rel="noreferrer">documentation</a> didn't really help.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Since I want the default context menu with only one or two minor changes, I'd prefer to not recreate the whole menu (though of course I will if it's the only way). What I'd like to do is something like this:</p>
  
  <pre><code>"contextmenu" : {
      items: {
          "ccp" : false,
          "create" : {
              // The item label
              "label" : "Create",
              // The function to execute upon a click
              "action": function (obj) { this.create(obj); },
              "_disabled": function (obj) { 
                  alert("obj=" + obj); 
                  return "default" != obj.attr('rel'); 
              }
          }
      }
  }
  </code></pre>
  
  <p>but it doesn't work - the create item is just always disabled (the alert never appears).</p>