A different use

Explorer like navigation tree for websites
Navigationsbaum für Internet Auftritte.
Post Reply
iainh

A different use

Post by iainh »

This post is about a different use for Treemenu.

I have a database and I need to enable users to search it. I have the usual search forms, 'refine my search' and such things, but I'm now experimenting with Treemenu. In effect I can allow a user to navigate the database like they would look for documents through Explorer.

The structure I have is:

Code: Select all

All of UK
 +-Region1
 |    +-Office1
 |    |    +-Item1
 |    |    |    +-Report1
 |    |    |    +-Report2
 |    |    +-Item2
 |    |         +-Report3
The tree is built dynamically from the database by a php script that runs through each region, office, and item, finally adding 'tree leaves' for any final reports.

Currently not all Regions have offices and not all offices have items and so here I've defined a custom icon, an empty folder with a red cross it it, and by defining this as the 'open icon' in the add command I neatly indicate branches that go no further by a 'dead end' icon.

How well this will all work with large data volumes I've yet to learn. The php script has to loop through the database building the tree and there may be some restructions on the size of the tree, but as a means of exploring a database it's wonderful so may be worth the wait for the tree to build.

.../Iain
User avatar
Hans
Site Admin
Posts: 77
Joined: 16 Dec 2005, 16:52
Location: Germany
Contact:

Thanks a lot

Post by Hans »

Hello 'Iainh',

thank you a lot for sharing your experiences with TreeMenu in this forum.

You've been unsure if there are restrictions with the size of the tree you can create. TreeMenu uses dynamical memory management and thus there are no restrictions with the number of items you can include in the tree. I optimized the speed of the script as much as i could and so far i found no javascript driven tree faster than TreeMenu.

To give you some speed assessment i was building up trees with a different number of items and measured the cpu-time TreeMenu needed to instantiate, read in the items, build the tree structure and to load and show the tree in the menu-frame on my pc (P4-3.2GHz, Firefox).
- 50 menu-items -> 0.04 sec. (small tree)
- 100 menu-items -> 0.08 sec.
- 200 menu-items -> 0.25 sec.
- 500 menu-items -> 0.61 sec.
- 1000 menu-items -> 1.31 sec. (really large tree)

These times may differ depending upon your pc-speed, the number of different icon-images to be loaded and possibly by the javascript/browser-type you are using. Because of the compact input format TreeMenu uses, also the additional time needed for download is minimized.

I hope the above informations are useful for you.

Thank you again for your efforts.
Hans Bauer
Your forum admin
Post Reply