473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

22
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_to_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_to_drawn is 4
John
|------>>Todlee
|________|------>>7539512
|__________________|------>>31540
Macy
|------>>Hunter
|________|------>>7865512
|__________________|------>>15000
__________________________________________________ ________________& if the No_of_Columns_to_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
Mar 29 '10 #1
4 4751
jhardman
3,406 Expert 2GB
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
Mar 29 '10 #2
Anni V
22
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
Mar 29 '10 #3
jhardman
3,406 Expert 2GB
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
Mar 29 '10 #4
Anni V
22
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
Mar 30 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Steve Johnson | last post by:
Been banging my head on this for two days now. Hope someone can help! My test program below is in the form of a single JSP, with a Node class build in. (All the coded needed to run is below.) ...
12
by: pillepop2003 | last post by:
Hey! Can anyone give me a hint, how this problem is best implemented: I have a table of users (see below), where every user has one "superior user" (= parent node), this should be a fully...
4
by: plork | last post by:
I'm trying to code a tree structure using javascript, the nodes of the tree are generated from a sql table. Has anyone some code for this? Cheers
1
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed...
1
by: Satish.Talyan | last post by:
hi, i want to create a dynamic tree hierarchy in javascript.there are two parts in tree, group & user.when we click on group then users come under that's tree category will be opened.problem is...
1
by: hmoundekar | last post by:
actually i want to generate a tree structure on client side, the application is simple web based, and need to display the data extracted from the database to client in tree structure. but the problem...
15
lwwhite
by: lwwhite | last post by:
I'm not sure if this discussion is a better fit for the Access or XML forum and I don't want to double-post, so I'm starting in Access because you've been so helpful to me here. I am preparing a...
2
by: windx | last post by:
hi, iam lacking idea in using dynamic tree structure which will be generated based on the data from the database. can anyone guide me in this logic. regards
8
by: =?ISO-8859-1?Q?m=E9choui?= | last post by:
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.