[thelist] Large expandable tree

Hershel Robinson hershelr at netvision.net.il
Wed Aug 27 12:51:47 CDT 2003

I have a page which shows an expandable/collapsible tree of nodes. The
server prints out the nodes in a JavaScript array and the client side code
builds the tree.

I am using a modified version of the tree code found here:

Everything works well, but now our trees are growing larger and the time to
build the tree is growing too large. This is not terribly surprising, given
the nature of the code and how it processes the array. When we first built
the page, I was not aware that our trees might grow so large. :)

The boss says that a 1500 node tree takes 2 minutes to build and we may soon
be seeing 6K nodes.

I am thus looking for suggestions for a better solution to this
tree-building business. I have examined several different approaches,
including those which print out the entire tree using a series of nested
<div> tags or a series of nested <ul> tags. I am wondering, however, if 6K
nodes (and maybe more) is a bit much even for these methods.

The MSDN Library tree code in the left pane loads in branches of the tree on
request. This is an interesting solution. Their particular implementation is
apparently somewhat lacking in documentation. I have not located anything on
it, nor has a certain forum which I visited.

If anyone has any suggestions as to how to handle this task, I would
appreciate the input.

Thank you,

More information about the thelist mailing list