Parent based TreeLoader

During development I found the leaf method doesn't fit our needs. I've built a custom treeloader which uses a parent base hierarchy method. It performs a single call to the server to retrieve the full json tree. It then loads the root nodes. The child nodes are not loaded into the tree until it is required. This allows us to minimize our server calls, simplify our server side work and optimize the user interactions.

This was done as a combination of fastest way to generate the data and using our existing parent based structure. Instead of building a complex json that would require server side recursion we simple output a single level json array. We also did not want the children to load initially. We have a site which has happen to grown to over 2000 pages. One option was to load all the nodes upfront but it takes way to long to generate that many. The other option was to use async but we found the response time to be to slow and it added extra load to a server that wasn't needed. Our answer was to perform a single call to server to retrieve the data. Then we simple load the nodes as required. This allowed us to maintain our parent structure but also keep the server and client side loads lite.

I know you already have it done but another way to think about it is if you have a static list you can use a script/cronjob that generates cache files somewhere for your async requests that way it doesn't have to hit a db or do a file recursion every time.

Sometimes the fastest way is a lookup table methodology. It is sometimes overlooked when the data is not changed very often.

Either way it is always good to have more ux additions.

cheers!

Mike Giddens
=======================
Opportunity is missed by most people because it is dressed in overalls and looks like work - Thomas Edison

I actually do cache my list on my server to prevent extra db calls. It was also the issue with the extra calls to the server. On a slower connection the wait for the async node to call the server, respond and then generate nodes can hurt user interactions.

I guess it really is based upon preferences, the focused audenence and application requirements.

Interesting indeed

I am in the same situation with a structure built on the childrens knowledge of their parent object and find your solution quite interesting for me. I tested you example but when i have expanded a folder it looses its "folder look" have no "minus" to click. Any ideas?