Django:Is there a way to use a tree control in my template‏

2.1k Views Asked by At

Hi i wanted to know is there a way through which i could use a tree control in my template I wanted to add something like

Student
    |_Name
       |_Address
       |_Contact No

I think you guys get the picture...How can i add something like that in my template...Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

django-mptt has template tags for displaying tree structures. I'm not sure whether it would be difficult to use them without storing your data as a tree in the database. This could be used to generate markup or json data for some JavaScript tree widgets.

0
On

This has nothing to do with Django. You can use any HTML/CSS/Javascript in your templates, so just use any script to create your tree control.

Here is one of jQuery scripts: http://www.boarsoft.com/javascript/dtree/?jdfwkey=97rdf1

Other examples: http://www.google.lv/search?sourceid=chrome&ie=UTF-8&q=jquery+tree