This component may be obtained, modified and distributed free of charge for personal as well as commercial use. Please see the license for the complete terms and exact wording.
(2006-05-26) Changed license to Apache Software License 2.0.
(2003-03-16) Version 1.17 - Added target property.
(2003-02-15) Version 1.16 - The selected node can now be distinguished even when the tree control loses focus.
(2002-10-29) Version 1.15 - This version is based on 1.13 and fixes the bugs 1.14 were supposed to fix.
(2002-10-23) Version 1.14 - Minor fix for a case where the plus icon used wrong image.
(2002-08-20) Version 1.13 - Added
usePersistence flag to allow disable the usage of cookies.
(2002-06-13) Version 1.12 - Various bug fixes.
(2002-01-27) Version 1.11 - Bug fixes and improved mozilla support.
(2001-09-23) Version 1.1 - New features included keyboard navigation (ie) and the ability to add and remove nodes dynamically and some other small tweaks and fixes.
(2001-03-18) Added getSelected and get/setBehavior that can make it behave more like the windows explorer
(check usage for more information about it).
(2001-01-10) Original Version Posted.
An object based tree widget with persistence using cookies that works in ie5 and mozilla.
This new version is based on objects, so you do not create the actual html code for the tree yourself, you create an object (the tree's root folder) and then you add child items to this. Once you're done adding items the actual html code is generated and inserted into the page. This makes it very easy to create and update the content of the tree (or to dynamically generate it). If you've seen Erik's new xMenu you will notice that it's working in similar way.
This script also features persistence using per session cookies. So now if you go to a page using this tree widget, expand a few folders and then leave the page again (by following a link or by typing a new url manually) it will store the state of each folder in a cookie so when you go back to the page it will remember what folders you last had opened and open them for you. This could be very useful if you use this for site navigation etc.
The persistence functionality is using the node creation order to remember the state of each node, this works fine for static trees, but not for dynamic ones since adding and/or deleting nodes will change the original order numbering.