Rob
Rob

Reputation: 3084

jQuery Treeview - Where do I start?

I want a treeview of dates with year, month and days. I will be using $.ajax to retrieve webservice json data. That bit is easy, but not sure how the json data should be constructed for the jquery treeview to work.

I am using http://jquery.bassistance.de/treeview/demo/ (not used before) in creating my treeview.

Upvotes: 0

Views: 856

Answers (1)

NinjaNye
NinjaNye

Reputation: 7126

I've not used bassistance but have used jstree which has good documentation and examples

This link may also be helpful: http://www.jstree.com/documentation/json_data

An example of the type of json sent down might be

new object[]{
             new {
                  attr = new {id = "node1"}, 
                  state = "closed",
                  data = new { 
                                  title = "Title1",
                                  icon = "ico-database"
                              }
                  },
             new {
                   attr = new {id = "node2"},
                   state = "closed",
                   data = new { 
                                   title =  "Title2",
                                   icon = "ico-database"
                              }
                  }
             };

Upvotes: 3

Related Questions