PDA

View Full Version : Multiple custom trees



AssetWorks
5 Feb 2013, 9:22 AM
I am currently working on a project that calls for two trees.
First tree will display all available menu and secon tree will display the selected menu
If someone checks a node in the available menu the selected menu should show the checked items of the available menu.
so far I got it that if they check the parent all children get checked and if they check the child the parent node gets checked also.
I know tree panel has a method called getChecked() however I ham having trouble on telling to getChecked() everytime the available menu gets checked.

init: function() {
this.control({
'#availablemenu': {
checkchange: this.onCheckedNodes
},
'#selectedmenu': {
>>>>>>>what event should I use: this.SelectedCheckedNodes
}
});

},onCheckedNodes: function(node, checked, eOpts){ if(node.isLeaf()){
if(node.parentNode.data.checked){
node.set('checked', checked);
}
else{
node.parentNode.set('checked', checked);
}
}
else{
node.cascadeBy(function(n) {
n.set('checked', checked);
});
}
},
SelectedCheckedNodes: function(self, node, records, successful, eOpts){
>>>>>>>>>>what code goes here to getChecked of first tree?

}

mitchellsimoens
7 Feb 2013, 1:23 PM
I'm not understanding what you are doing. What are you needing to capture from the second tree?

AssetWorks
8 Feb 2013, 5:09 AM
I need to show only the checked items from the first tree. so basically build the tree as its being check.