Question

I have created a tree navigation menu using Dynatree (http://wwwendt.de/tech/dynatree/index.html). The tree has four levels: company, group, user and computer. Every object in the tree is selectable (seleting the object opens a page showing the properties of that object), and each object can have children except for the level 4 objects ("computer").

Now I have tried to make the tree lazy-loaded according to the instructions in the documentation: http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html#lazyLoading The first-level content loaded from the background has the isLazy option set to true and I have added the onLazyRead callback to the tree.

What I need from the tree: the first level is always loaded but expanding the first level object with the [+] character expands the first level object and loads the underlying objects (group, user, computer) in the background. Loading the tree works in the sense that I can see the first level elements, but the problem is that

  1. the [+] sign is not displayed when the node doesn't have any children
  2. if the node has children, the onLazyRead event is not executed

This seems like a catch-22, as there seems to be no option to make a node expandable without it having children, making it impossible to make the tree lazy-loading. What am I missing?

Was it helpful?

Solution

If your server delivers nodes that are to be lazy loaded, you must set the node.isLazy attribute to true.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top