[jQuery] [TreeView] Dynamic tree and location persistence problem

[jQuery] [TreeView] Dynamic tree and location persistence problem


I am using TreeView to generate a tree of the content on my website which is
dynamic. If content is added the tree grows. The way I manage the dynamic
tree is by creating a new tree whenever content is added and loading the
newest tree to be displayed in the webpage.
My idea is to use loaction based persistence in order to allow all users to
be aware of their location within the content tree.
When navigating content by clicking on the tree, the tree always highlights
the location.
When navigating content by clicking on the content itself I seem to have a
problem.
Initially I did:
<script type="text/javascript">
$(function() {
$("#tree").treeview({
collapsed: true,
         animated: "medium",
         control:"#sidetreecontrol",
         persist: "location"
});
})
</script>
In this case only the last user to add content to the tree will be able to
click any content and have his location highlighted on the treeview.
Next I tried something else: (added cookieID although I am using location
based persistence.
<script type="text/javascript">
$(function() {
$("#tree").treeview({
collapsed: true,
         animated: "medium",
         control:"#sidetreecontrol",
         cookieId: "<?php echo $_SESSION['USER_ID']; ?>",
         persist: "location"
});
})
</script>
In this case the last user to login to the website can navigate content and
the tree will be highlighted correctly, showing the user's location within
the content tree.
In the case another user logs in, then this last user will be able to
navigate and see his position in the navigation tree, while the previous
user will no longer be able to do so.
I would greatly appreciate some help regarding this as I have been stuck
with it for very long.:confused:
Thanks!! :-)
--
View this message in context: http://www.nabble.com/-TreeView--Dynamic-tree-and-location-persistence-problem-tp22022599s27240p22022599.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.