jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree How do I turn a node in a tree into a link

This topic contains 6 replies, has 2 voices, and was last updated by  scrummie 12 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author

  • scrummie
    Member

    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!


    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    scrummie
    Member

    Thank for you responding, but in the demo that you sent the do not have links in them…

    ******* snip ****************

    Home
    Solutions

    Education
    Financial services
    Government
    Manufacturing
    Solutions

    Consumer photo and video
    Mobile
    Rich Internet applications
    Technical communication
    Training and eLearning
    Web conferencing

    All industries and solutions


    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    scrummie
    Member

    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


    scrummie
    Member

    I have tried attributes such as:
    – url
    – uri
    – destination
    – link
    – target

    all with no joy.


    scrummie
    Member

    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}" }
    ]
    }
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.