How to Display a dynamic tree structure which populates data from a database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anni V
    New Member
    • Feb 2009
    • 22

    How to Display a dynamic tree structure which populates data from a database

    Hi
    I request you to kindly help me with the code for a reusable tree structure component that displays a tree view as displayed in the attachment.

    Consider a table named : Employee with the following fields

    Emp_Fname Emp_Lname Emp_Contact Emp_Salary
    John Todlee 7539512 31540
    Macy Hunter 7865512 15000
    Steve Abley 7964812 32656
    Tom Proctor 7646879 56456

    I need to pass parameter to this componenet As
    generater tree (Connection String(SQL), Table_Name, No_of_Columns_t o_drawn)

    I have been trying the same with Javascript but I can't get the logic to create a function that will display the tree structure dynamically on passing these parameters.

    For example:
    generater tree (Connection String, Employee, 4)

    The tree would be such if the No_of_Columns_t o_drawn is 4
    John
    |------>>Todlee
    |________|------>>7539512
    |______________ ____|------>>31540
    Macy
    |------>>Hunter
    |________|------>>7865512
    |______________ ____|------>>15000
    _______________ _______________ _______________ _______________ ______& if the No_of_Columns_t o_drawn is 3
    John
    |------>>Todlee
    |________|------>>7539512
    Macy
    |------>>Hunter
    |________|------>>7865512


    I would be grateful if anyone could help me out with this code, I want to use it in multiple pages on my ASP application,

    Thanks a Lot
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    this is a very difficult task for ASP classic. Are you sure this is what you want to do, or do you want to try it in ASP.NET which has some of these features built in?

    Jared

    Comment

    • Anni V
      New Member
      • Feb 2009
      • 22

      #3
      I know it is very difficult, I have been trying it out, but it doesn't seem to work out,
      Thanks a lot for your suggestion & help, but
      I am not familiar how to achieve this through ASP.NET, could someone please assist me on that.
      I have a doubt if I manage it in ASP.NET, Could I generate a dll file & then utilise this in my classic ASP pages.

      Anni

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        i've actually done something similar. Basically, I pulled all the data into hidden div's under the data headings, then used a checkbox hooked up to some javascript that made the divs visible when the user clicked them. Does that make sense? It was a lot of work, but it did work in the end.

        Jared

        Comment

        • Anni V
          New Member
          • Feb 2009
          • 22

          #5
          I tried pulling the data into divs & then retrieving the same but it kept giving me junk values,
          You suggestion is good friend, but I don't think i am able to achieve the same, I know what I am trying to achieve is tedious but once done ,it can serve as a reusable component for any page.

          I would request if you (sorry,it may sound wierd) could help me with something of an alternative to this, it would be much more helpful,

          Thanks a lot buddy

          Anni V

          Comment

          Working...