jQWidgets Forums
jQuery UI Widgets › Forums › Navigation › Tree › How do I turn a node in a tree into a link
Tagged: jquery tree, jqxtree, tree menu widget
This topic contains 6 replies, has 2 voices, and was last updated by scrummie 12 years ago.
-
Author
-
I must be missing something, but I am trying to make the nodes in a tree clickable and have the user taken to a url. There is no “url” or “link” or “destination” attribute and I have tried “value” with no success. This is such a basic thing that I must be doing something wrong. Please help!
Hi,
You can create jqxTree from UL and place anchor tags in the LI items. Here’s a sample with Tree created from UL: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/treepopup.htm?web
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Thank for you responding, but in the demo that you sent the do not have links in them…
******* snip ****************
Home
SolutionsEducation
Financial services
Government
Manufacturing
SolutionsConsumer photo and video
Mobile
Rich Internet applications
Technical communication
Training and eLearning
Web conferencingAll industries and solutions
Hi scrummie,
Yes, the demo is with a Tree built from UL and LI. Inside the LI tags you can put anchor tags instead of simple text as I pointed out in my previous post.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/But what if I am building the tree using JSON? Here is a snippet of my JSON:
{ icon: "images/folderIcon.png", label: "Java Src", expanded: false, items: [ { icon: "images/favorites.png", label: "Overview (Java EE 6 )" }, { icon: "images/favorites.png", label: "Overview (Java Platform SE 6)" }, { icon: "images/favorites.png", label: "Overview (Java Platform SE 7 )" } ] },
This creates a folder called “Java Src” with three nodes underneath them. So how in JSON do I add a url to these nodes?
Regards,
Jay
I have tried attributes such as:
– url
– uri
– destination
– link
– targetall with no joy.
I was being very dim… I apologize for that, not enough coffee…
icon: "images/folderIcon.png", label: "Search Engine", id:"{id from db}", value:"{insert value here}", expanded: false, items: [ {label: "<a href='http://google.com' target='_blank'> Google</a>", id:"{id from db}", value:"{insert value here}" } ]},{icon: "images/folderIcon.png", label: "Another folder", id:"{id from db}", value:"{insert value here}", expanded: false, items: [ {label: "<a href='http://someOtherDomain.com' target='_blank'> Test</a>", id:"{id from db}", value:"{insert value here}" } ]}
-
AuthorPosts
You must be logged in to reply to this topic.