ludo.tree.Tree

ludo.tree.


new ludo.tree.Tree(config)

Tree widget

Parameters:
Name Type Description
config Object
Properties
Name Type Description
defaults: Object

Default values for properties not present in data, example:

defaults: {
"icon": "images/icon.gif"
}

tpl Object

Template strings for how to render nodes in the tree.
Example:

tpl: '{title}

which renders JSON like : [{"title": "First node" },{"title": "Second node"}]
as "First node".
You can also have more than one template.
Example:

tpl:{
tplKey : 'type',
city : 'City : {city}',
country : 'Country : {country}
}

for JSON like:

[ { type:"country", "country" : "United States" }, { "type": "city", "city": "Washington" }]

tplKey refers to the "type" attribute. When type is "country", it should use the "country" tpl. When type is "city",
it should use the "city" template.

Source: