Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6167499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:31:27+00:00 2026-05-23T22:31:27+00:00

I want to turn an ordinary nested list, into a collapsable tree like structure

  • 0

I want to turn an ordinary nested list, into a collapsable tree like structure such as dtree. I have the list right now as html with nested tags, I want to implement this sort of tree but need some steps on how to do it. The site doesn’t do a very good job at explaining it.

Thanks!

tariq

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:31:29+00:00Added an answer on May 23, 2026 at 10:31 pm

    This is the code to use after you have included the proper javascript files that dtree provides:

    //Create the tree
    d = new dTree('d');
    
    //Add a node and keep adding the rest of the nodes until they are all in there
    d.add(
          1, //Unique id for the node
          -1, //Parent node -- use -1 for root
          'My node', //Text Label for the node 
          'node.html', //Url for the node
          'node title', //Title for the node
          'mainframe', //Target for the node when opening the url
          'img/musicfolder.gif' //Icon image. Uses default if not specified
          'img/musicfolderOpen.gif' //Open Icon image. Uses default if not specified
          true //Whether the node is open or not (optional)
         );
    
    //write the node to the html page
    document.write(d);
    

    I recommend using an easier javascript tree like ‘Simple Tree Menu’ which is easier to set up. Simple Tree Menu can be found here:

    http://www.generalflows.com/www/software#sys/SimpleTreeMenuView

    The js can be downloaded here:

    http://www.generalflows.com/js/lib/jquery/jquery-simpleTreeMenu-1.0.0.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of objects which I want to turn into a set.
I have a list of tuples and want to turn this list into a
I want to turn a program I have into a service so I can
I have a set of points that i want to turn into a closed
I have the following array, $myarray[0]['first_name'] $myarray[0]['last_name'] I want to turn it into: $myarray['first_name']
I want to turn a long string like reallyreallyreallyreallyreallylongfilename into something like reallyreallyre...yreallyreally .
In PHP I have an array of bytes that I want to turn into
I have a piece of text and I want to turn it into a
I want to turn something like <sup>1</sup> into <sup><a href=... class=...>1</a></sup> I figured the
I want to turn my table rows into links using JS. I have it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.