title: Dynamically change JSTree sort order
body: <p>I'm using JSTree to display a small Windows Explorer-like appearance, everything is perfect but I have to implement sorting option also, is there anyway that I can have my tree sorting order dynamically changed? For example I can have a button that allows user to sort contents based on name (asc or desc), size, change date or even type. How can I perform it?
  I think there is something wrong with JSTree sort plugin, or at least I cannot understand how it works!</p>
  
  <p>This is what I do in order to change sort based on user interaction:</p>
  
  <pre><code>treeInst = $('#divWindowsExplorer').jstree(true);
  var root = treeInst.get_node('j1_1');
  $.jstree.defaults.sort = function (a, b) {
      return this.get_text(a) &lt; this.get_text(b) ? -1 : 1;
  };
  $("#divWindowsExplorer").jstree(true).sort(root, true);
  $("#divWindowsExplorer").jstree(true).redraw_node(root, true);
  </code></pre>