I want something very simple:
A jQuery widget that presents a tree which is collapsible. I want the state saved. And I want to control what the initial state is. I want it to look very pretty. And when the user clicks on a link I want it to navigate there. Easy.
It looks to me like Jqtree is what I am looking for, but looking through all the doc I don't see the simple case of indicating the url that goes with a node in the tree.
- Given my requirements do you agree that Jqtree is the right solution?
- Is there a useful sample somewhere I can look to see how my case is handled?
The nodes are just Javascript objects so you should be able to just add another property for url. So, for example, adapting what's on the jqTree website:
Now, obviously jqTree won't do anything with this by default, so you'll have to handle that, but any time you are able to get a node, you should be able to retrieve it's
.url
:So, for example, it looks like jqTree has a tree.click event: