Lazy loading of data

With FoamTree 3.2.0 and later you can defer loading of the data for lower levels of the hierarchy until the data is really needed, that is when the user opens the parent group. Click-and-hold or double-click a group with the » suffix to load its child groups.

In a real world, you would probably load data from a remote server using Ajax, but for the sake of this demo we simply generate new data and simulate the loading delay using window.setTimeout().

For very deeply-nested hierarchies, FoamTree will hit the limit of double floating point precision and will not be able to generate child groups. In such scenarios, the group will be annotated with the »» suffix. The only way to let the user browse the contents of such a group is to reload FoamTree with the relevant sub-hierarchy.

What's in the code?