title: attach function to before.jstree
body: <p>I'm trying to prevent deletion of the root-node in jstree. In earlier versions there was the before.jstree event, with which you could do it like this:</p>
  
  <pre><code>.on("before.jstree", function (e, data) {
      if(data.func === "delete_node") {
          if (data.node.type == "root_node" || true)
          {
              e.stopImmediatePropagation();
              return false;
          }
      }
  })
  </code></pre>
  
  <p>But since the before.jstree method has been cut in jstree 3(<a href="https://www.jstree.com/api/" rel="nofollow">https://www.jstree.com/api/</a>), this approach doesn't work anymore. Is there an alternative solution without manipulating the contextmenu event?</p>