CodeThatTree - Tree Positioning Example
var TreeDef = {
"style" :
{
"imgitem" : "img/ats.gif", // Image for leafs
"imgdir" : "img/atg.gif", // Image for directories
"imgdiropen" : "img/ato.gif", // Image for directories in open state
"itemoffset" : {
"x" : "10", "y" : "0"
}
// Offset for a next tree level
},
// Main items array. In this case has one item Item1
"items" : [
{
"text" : "Item1",
"style" : {
"itemoffset" : {
"x" : "30", "y" : "3"
}
},
// Subtree definition
"menu" :
{
// Subitems array.
"items" : [ {
"text" : "Item1"
},
{
"text" : "Item2"
},
{
"text" : "Item3"
} ]
}
},
{
"text" : "Item2",
"style" : {
"itemoffset" : {
"x" : "50", "y" : "10"
}
},
// Subtree definition
"menu" :
{
"items" : [ {
"text" : "Item1"
},
{
"text" : "Item2"
} ]
}
} ]
};