title: Clear cache from jstree node
body: <p>I want to force an ajax call every time the user opens a node i.e. no caching.   A little googling suggested deleting the children of a node after the user closes it.  Seems pretty simple but I cant get it to work.<br>
  In the code below the after_close event is in fact fired but the three statements to delete the child nodes appear to have no effect.  I conclude this because I observe the initial ajax call in fiddler when the node is first opened but closing the node and re-opening it does not generate a call.
  Notes:
    I am using a random number parameter to prevent caching on the browser.
    I have set the 'check_callback' flag per <a href="http://www.jstree.com/docs/interaction/" rel="nofollow">the documentation</a>.</p>
  
  <pre><code>// load the tree
          $('#tree').jstree({
              'core': {
                  "themes": { "theme": "classic", "dots": false, "icons": false },
                  'html_titles': true,
                  'load_open': true,
                  'data': {
                      'url': 'GetChildNodes/',
                      'data': function (node) {
                          return { 'id': node.id === '#' ? '0_0' : node.id, 'noCache': Math.random() };
                      }
                  },
                  'check_callback': function () { return true; }
              },
              "plugins": ["themes", "ui"]
          });
  
          // Handles tree view links so that the tree view does not intercept the event.
          $("#tree").delegate("a", "click", function (e) {
              if ($("#tree").jstree("is_leaf", this)) {
                  document.location.href = this;
              }
              else {
                  $("#tree").jstree("toggle_node", this);
              }
          });
  
          $('#tree').on('after_close.jstree', function (e, data) {
              var tree = $('#tree').jstree(true);
              var children = tree.get_children_dom(data);
              tree.delete_node(children);
          });
  </code></pre>