2

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

Murphy316
  • 766
  • 3
  • 13
  • 29

2 Answers2

2

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

Silver Light
  • 44,202
  • 36
  • 123
  • 164
2

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.

Community
  • 1
  • 1
Benjamin Atkin
  • 14,071
  • 7
  • 61
  • 60