PDA

View Full Version : Huge treeview; what technique to use?


Diaan
06-18-2008, 09:51 AM
I need to build a treeview, containing up to 15.000 items.
What would be the best technique to build such a thing?

- It must be possible to update certain parts of the tree without refreshing the whole page.
- It has to download and render fast.

I've been looking at javascript/css, asp.net components (www.telerik.com) and flex.

Any pros and cons or other thoughts?

gnomeontherun
06-18-2008, 05:44 PM
Welcome to the forums!

15,000 items? I don't think there is anything out there that will render something that large quickly at all. Are you sure you are wanting to do this?

There are probably methods, but any technique I'm aware of loads the entire list of items. In this case you seem to be asking for a way to only load the top level items, and then loading the subitems as requested. I am thinking that your best bet would be to find a way to make that list more manageable. Perhaps a treeview is not the method by which you should be using to display these items? Perhaps you can break it down into groups of 100 items or something much more manageable.

Also don't just think about technologically, but what about your users? If I visited a site and was presented with 15,000 items, I'd leave because of the overwhelming number of things in my face. Is there anything to do to simplify?

oesxyl
06-18-2008, 05:52 PM
I need to build a treeview, containing up to 15.000 items.
What would be the best technique to build such a thing?

ajax, json?.
- expand/collapse used/unused branch of the tree, only one branch expanded, if is possible
- request data for subtree only when expand a branch
- cache the requested data on client side on each request

look before that to your design, must be a better way then loading 15000 items.

regards

Diaan
06-19-2008, 09:09 AM
Thank you for your answers.

It is not an openly accessible website I'm building but a webapp with which you can build, manage and take exams. Each exam is generated individually from a large question-database. At the moment the largest question-database is 7000 items, but if we're redesigning we might as well be prepared for the future ;)

I also thought about loading the content of a branch when opening it. It might eventually take just as long to download the tree branch by branch as is takes to download the whole tree at once, but at least the user had the idea something's happening.

oesxyl
06-19-2008, 07:28 PM
I also thought about loading the content of a branch when opening it. It might eventually take just as long to download the tree branch by branch as is takes to download the whole tree at once, but at least the user had the idea something's happening.
overall probably loading branch by branch take more time then all at once because of the time of each call but the avantage is that insead of waiting a longer period of time to load all, user wait only the time needed to load the current branch, :)
I guess this is what you have in mind when you said last sentance, but just in case, :)

regards