tags:

views:

51

answers:

2

Can I somehow insert a table inside <li> when using

  • jsTree (1.0) and
  • json?

let's say in this code where I want to insert table for

  • both node and
  • leaf.

Why? To display more things than only a name and using nice formatting.

                "data" : [
                    {
                        "data" : "A node",
                        "children" : [ "Child 1", "Child 2" ]
                    },
                    {
                        "attr" : { "id" : "li.node.id" },
                        "data" : {
                            "title" : "Long format demo",
                            "attr" : { "href" : "#" }
                 }
                    }
                ]

update:

it seems to me that I can use html_titles. But could somebody give me an example how to insert whole table and get cell data from variables?

Update2:

whether I use

"data" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table>", 

or

"title" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table",

the table is placed on a new line. Not next to the tree icon. Can I fix that somehow?

A: 

I thought it needs to be solved on javascript level but <table style='display: inline-block'> does the trick

Radek
A: 

I have been trying to do something similar where I need to right align a number, but have been unable to get it to work.

Dennis Burton
hopefully somebody knows ...
Radek