Hello, I am making some tests with YUI treeview to integrate it in one of my Moodle pages.
I noticed that the examples (http://developer.yahoo.com/yui/examples/treeview/folder_style.html) do not preserve the folders expanded / collapsed status when you navigate to another page and back again. It seems that the whole treeview is rebuilt from scratch whenever the page is shown/rendered again.
Is there a possibility to keep the whole tree as it is, i.e. with all folders expanded and/or collapsed when the user navigates forth and back from one web-page to another?
In my case the tree would appear on every page the user visits, displaying the same tree (as it represents the site-navigation), and hence it would prove a very poor user experience if the user had to start over expanding all folders again on every new page. Normally the tree should represent exactly the path where the user navigated to, but without recalculating it on the server, because recalculating wich folders should be expanded, would mean to keep track of every mouse-click the users make in the treeview and send this information back to the server. It would certainly be more efficient if the next page containing the same treeview code would not trigger a new rendering of the whole tree in its default state, but would render it exactly as it was on the previous page.
If you want to see a working example, please visit
https://moodle.fhnw.ch, expand any folders in the siteNavigation block. Navigate onto any other web-page and back using your browser's back-button. The library I am using there is HTML-TreeMenu but I would like to switch over to YUI treeview, but without the users losing look and feel of the actual implementation.
Thanks for any hints, Rosario