title: jstree: incremental loading
body: <p>The <a href="http://jstree.com" rel="nofollow noreferrer">JStree plugin for jQuery</a> allows you to load data to feed a navigable tree GUI element provided by the library.</p>
  
  <p>For small trees, just load them all in memory, and you're done. But for large trees, that might not be a good solution. The all-in-memory approach doesn't scale.</p>
  
  <p>Think 6000 nodes (or 60,000), most of which will never be relevant to the user viewing the page. Wouldn't it then be better to load only the first level of branches and incrementally load more branches following the user's clicks along what's already displayed? It certainly would.</p>
  
  <p>You'd mark the tree where it has missing branches, then you'd load the missing branches on demand, remove the mark from the tree, graft the branch onto the tree, and proceed in that manner recursively if necessary.</p>
  
  <p>How do you do imcremental loading? I found a <a href="https://stackoverflow.com/q/2427039/269126">question from 2009 pertaining to the same problem</a>, but the API appears to have changed. Does anyone have a recipe of how to proceed for the current version of the library?</p>
  
  <p>Note incremental loading is not the same as incremental rendering, which is another optimization already provided by the library.</p>