Jack真是贴心周全啊。Node中attributes属性是开放出来供开发者自己定义属性用的。如果在定义json data时希望把自己需要的属性也加进去,能被load出来。那么用这个public property就好了。
轻松快意,想放多少放多少。
// json data
[{
"id":"haha",
"text":"haha",
"contentLink":myurl
}]
// get the node contentLink
treePanel.on('click', function(node){
var link = node.attributes.contentLink;
......
});
轻松快意,想放多少放多少。