473,721 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generate tree structure using database

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 static HTML tree using http://www.treeview.net. now i need to
generate this tree dynamically.

Can any one has code for this?

Jul 23 '05 #1
1 7179
"Srihari" <sr***********@ yahoo.com> wrote in message
news:81******** *************** *******@localho st.talkaboutpro gramming.com...
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 static HTML tree using http://www.treeview.net. now i need to
generate this tree dynamically.

Can any one has code for this?

----- Original Message -----
From: "Srihari" <sr***********@ yahoo.com>
Newsgroups: comp.lang.javas cript
Sent: Sunday, September 12, 2004 4:41 PM
Subject: generate tree structure using database

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 static HTML tree using http://www.treeview.net. now i need to
generate this tree dynamically.

Can any one has code for this?


Hi there, it depends on the format of your data I should imagine, it's quiet
easy to calculate, for instance, the x and y co-ordinates of your elements
as long as the data is related in some way. That's what I do for an
organisation chart at http://camshag.co.uk/svg/NHSTrust/index.html It's a
simple little algorithm... but then again it did take me 6 weeks to figure
it out ;-)
If that doesn't float you're boat then there are commercial javascript
solutions which'll organise data from a database... have a good google!
Cheers,
Dom
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
14035
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.) The technical requirements: 1) Store tree data in the database so that it can be extracted as a tree structure. For test purposes,
7
2899
by: Casper | last post by:
In scanning a drive and comparing file content, I need to remember filepaths to every single file I encounter so I can take actions on certain files later on. Rather than having a huge list enumerating the complete filepath to every file it seems the smarter way (faster, more memmory efficient) is to model the filesystem treestructure in a abstract tree - and having only the filenames & node pointer in an Array. struct tree {
12
6989
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 unambigous tree structure. The root node can have whatever value you prefer, I suppose NULL would be good for a start. What I want to do is finding the way from an arbitrary node in the tree. Example:
4
1985
by: Robin Tucker | last post by:
Hi, I'm currently implementing a database with a tree structure in a table. The nodes in the tree are stored as records with a column called "Parent". The root of the tree has a "NULL" parent. The path to each node is stored in the column "Path" and is of the form "\000001\000002\000003\" etc. The latter enabling me to fetch subtrees using the "LIKE" predicate. I also have created the relation "ID" <-> "ID_Parent, effectively the...
4
2771
by: Sasha | last post by:
Hi everyone, I would like to hear your opinions about a design solution I am contemplating. The problem I am following: Write an editor for a data structure that is recursive in nature. In other words it is a tree, where child nodes can contain links to parent nodes. And there multiple kind of nodes: Here is an example
10
5962
by: Will Honea | last post by:
I have a data set which I need to analyze but I am having a problem figuring out a structure for the database - or whether there are better ways of attacking the problem. The base data set is a large number of replies to a survey questionaire. I have adapted a NLP program to produce lexically annotated structural trees which appear to reasonably accurately reduce the text to descending trees. These trees consist of multiple nodes each...
1
2274
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 is that i need to display the tree of the data in tabular format, means expanding of tree should expand the table rows and collapsing of tree should collapse the table rows. if any one knows the way to do this, plz help me out. u all can mail...
15
2678
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 presentation comparing using a relational database vs. a native XML database within a content management system to manage XML-based documentation. The point I am trying to make is how difficult it can be to reconstruct the XML hierarchy/tree once the...
7
5680
by: PaowZ | last post by:
Hi there! I'm facing an issue concerning tree data structure in php. In others languages, I just need to create a root node which I bind pointers of instances representing others nodes. But I couldn't find a way to do so in php language. Indeed, object instances are "volatile" reaching the end of the script. How could I build a tree with "volatile" address pointers in php ? I could use arrays to store data like a tree structure but I'd...
0
8730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.