|
-
Dec 25th, 2009, 08:39 AM
#1
Thread Starter
Member
Treeview structure in PHP
Hello All
Can somebody help me in getting a treeview structure uisng PHP script. I would be fetching the details from database. I am looking for something like this
- Parent1
- Child1
- Subchild1
Content
- Parent2
+ Child2
- Child3
- Content
A -ve sign need to be shown if it is expanded , If not a +ve sign.
Can we do this is PHP Script .. Can somebody help me please.
Thank You
Neha
Last edited by NehaRao; Dec 25th, 2009 at 08:42 AM.
-
Dec 25th, 2009, 09:27 AM
#2
Fanatic Member
Re: Treeview structure in PHP
could you explain a bit more, because i believe this would be simple... where does the parent come from and where dose the child come from? and the content is that in the tree view or outside?
edit: could this help you with you want done?
http://www.berthou.com/us/2008/03/27...eeview-in-php/
Last edited by Justa Lol; Dec 25th, 2009 at 09:33 AM.
-
Dec 25th, 2009, 09:52 AM
#3
Thread Starter
Member
Re: Treeview structure in PHP
Hello Justa
That is what exactly I wanted to do . Thansk for the example. But Now I need to fetch my details from the database.
Parent and childs comes from MySQL DB. When I pass the parent value , I Can fetch the child value and so on.. Hope I answered ur question
Thank You So much for immediate help
-
Dec 25th, 2009, 11:44 AM
#4
Re: Treeview structure in PHP
you pretty much just have to fetch everything that would appear in the tree at the time; so you must fetch all of the titles, and then for every title that is "open," you must fetch the subtitles, and for every subtitle, you must fetch the content. the easiest way to build it, in my opinion, is using a big array. you could probably store the menu's look in a session, or the query string.
I have absolutely no idea how you would manage this using the class listed above. the documentation for how to use it effectively doesn't even exist, but it does have a few examples; these don't seem too helpful, though. this class allows you to use text files to generate a menu, so you could cache a copy of your database in the textfile in the treeview class format so that it could use it. sounds like a pain though.
if you don't possess the knowledge to build this yourself, I'd suggest googling to find another tree-view generator instead. one that can build a tree-view from an array, or something.
Last edited by kows; Dec 25th, 2009 at 11:53 AM.
-
Dec 30th, 2009, 11:52 AM
#5
Fanatic Member
Re: Treeview structure in PHP
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
i haven't got time to make anything, sorry for that, but i found a link you could try experimenting with...
-
Dec 30th, 2009, 11:54 AM
#6
Re: Treeview structure in PHP
that really doesn't help all that much; the issue is the ability to get the content and put it into the tree, not making a tree view itself. :/
-
Dec 30th, 2009, 02:50 PM
#7
Fanatic Member
Re: Treeview structure in PHP
well sorry about, i wish i could help right now but i can't, I'm too busy making a website(not for my self)... got 3 people asking me to make them websites for cash, finally got something for my knowledge, but still my 8 languages aren't useful as i'm not an interpreter.. hehehe
-
Jan 1st, 2010, 01:57 PM
#8
Thread Starter
Member
Re: Treeview structure in PHP
I still couldnt arrive at any solution for the issue. As Kows said, its not about building the treeview. Its about populating the content from the database into treeview.
Parent1
----->Child1
--->SubChild11
-------> Child11Content
--->SubChild12
-------> Child12Content
Parent2
----->Child1
----->Child2
--->SubChild21
-------> Child21Content
--->SubChild22
-------> Child22Content
The relation and content between parents and childs is stored in mySQL DB.
-
Feb 1st, 2010, 01:24 PM
#9
Thread Starter
Member
Re: Treeview structure in PHP
Hello
Thanks Justa
I did achieve using the example explained in
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
Thanks for it
-
Feb 2nd, 2010, 12:11 AM
#10
Fanatic Member
Re: [RESOLVED] Treeview structure in PHP
oh man sorry i completely forgot this topic!
-
Feb 15th, 2010, 06:53 AM
#11
Thread Starter
Member
Re: [RESOLVED] Treeview structure in PHP
Hello All
My above solution is not working in realtime. It is hitting the performance badly. I believe that the tree is loaded at the time of page loading. Its not dynamic. I would want the childs to be loaded only when the parent node is clicked . When the parent node is clicked I want to query the MySQL DB and get the childs and populate the tree.
Can anyone help me please.
Thanks
Neha
-
Feb 15th, 2010, 12:22 PM
#12
Re: [RESOLVED] Treeview structure in PHP
you didn't ever post your solution, so it's a little hard to help.
-
Feb 16th, 2010, 02:07 AM
#13
Thread Starter
Member
Re: Treeview structure in PHP
Hello
I have implemented the same solution explained in
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
Thanks
-
Feb 16th, 2010, 02:37 AM
#14
Re: Treeview structure in PHP
that solution is simply JavaScript playing with HTML. it sounds like you're looking for an ajax-powered treeview.
-
Feb 16th, 2010, 08:35 PM
#15
Re: Treeview structure in PHP
Your threads have been merged.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|