title: How to get parents of each removed node using jstree?
body: <p>I copied my working example into jsfiddle <a href="http://jsfiddle.net/vvMaG/56/" rel="nofollow">http://jsfiddle.net/vvMaG/56/</a></p>
  
  <pre><code>&lt;html&gt;
  &lt;script type="text/javascript" src="../_lib/jquery.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="../_lib/jquery.hotkeys.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="../jquery.jstree.js"&gt;&lt;/script&gt;
  &lt;div id="menu"&gt;
  &lt;input type="button" id="remove" value="remove" style="display:block; float:left;"/&gt;
  &lt;/div&gt;&lt;br&gt;&lt;br&gt;
  &lt;div id="tree"&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;a&gt;List item one&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a&gt;List item two with subitems:&lt;/a&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a&gt;Subitem 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a&gt;Subitem 2&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a&gt;Final list item&lt;/a&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a&gt;Subitem 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a&gt;Subitem 2&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      $(function(){
              $("#tree")
                  .jstree({
                      "plugins":["html_data","ui","themes","crrm"],
                      "themes" :{
                          "theme":"classic"
                      }
                  })
                  .bind("select_node.jstree", function (e, data) {
                      /*point 1 here*/
                      var parent=data.inst._get_parent(data.rslt.obj);
                      console.log(parent.find('a').first().text());
                  })
                  .bind("remove.jstree", function (e, data){
                      /*point 2 here*/
                      var parent=data.inst._get_parent(data.rslt.obj);
                      alert(parent.find('a').first().text());
                      /*point 3 here*/
                      data.rslt.obj.each(function () {
                          console.log(data.rslt.parent.children()[1].text);
                      });
                  })
      });
      $(function () { 
          $("#menu input").click(function (){
              $("#tree").jstree(this.id);
          })
      });
  &lt;/script&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>When I select a node, it correctly gets the parent (point 1). However I suspect this method doesn't work when the node is removed as there is no parent for a node that has been removed (point 2) because I get a <code>parent.find is not a function</code> error.</p>
  
  <p>The only way I know how to get the parent is by looping through <code>data.rslt.parent.children()</code> (point 3). However obviously this only gets the first parent as I'm going through the <code>rlst.parent</code> and not <code>data.rslt.obj</code>. There is no such <code>data.rslt.object.parent</code> that I know of when I have selected <strong>multiple</strong> nodes to delete.
  Is there a way to get ALL parents of the deleted nodes?</p>
  
  <p>Thanks</p>