1. Method 1
The code copy is as follows:
var tree = L5.getCmp('edocOutfileRelationTree');
//Add a selection tree, the nodes will collapse automatically
tree.on("click", function(node,e){
node.getUI().toggleCheck(true);
});
tree.root.expand();
2. Method 2
The code copy is as follows:
var tree = L5.getCmp('orgstrutree');
//Add a selection tree, the nodes will collapse automatically
tree.on("click", function(node,e){
if(node.expanded==false){
node.expand();
}else{
node.collapse();
}
});
Use in combination:
The code copy is as follows:
var tree = L5.getCmp('orgstrutree');
//Add a selection tree, the nodes will collapse automatically
tree.on("click", function(node,e){
var organType = node.record.get("organType");
if(organType == "8"){
node.getUI().toggleCheck(true);
}else{
if(node.expanded==false){
node.expand();
}else{
node.collapse();
}
}
});