Indesgin - collapse treeview
Hello everobody,
I have build a Window with a TreeView and 2 radio buttons.
1 radio button to expand all nodes // 1 radio button to collapse all nodes
OnClick on each radio button called a specific recursive function that expand or collapse my tree :
// Expand all treeview nodes
function expand_tree(my_treeview){
my_treeview.expanded = true;
var branches = my_treeview.items;
for (var i = 0; i < branches.length; i++) {
if (branches[i].type == 'node') {
expand_tree (branches[i]);
}
}
}
// Collapse all treeview nodes
function collapse_tree(my_treeview){
my_treeview.expanded = false;
var branches = my_treeview.items;
for (var i = 0; i < branches.length; i++) {
if (branches[i].type == 'node') {
collapse_tree (branches[i]);
}
}
}
expand_tree function expand all nodes into my tree
But, collapse_tree function seems to do nothing…
I think my_treeview.expanded = false is the problem.
I test it with my_treeview.collapsed = true but unsuccessfully
Do you have any idea ?
Thank you
