Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically check/uncheck all subtree nodes in extjs tree when certain node gets checked/unckecked

How do I automatically check/uncheck all subtree nodes in an extjs tree when a certain node gets checked/unckecked. I already have my tree with checkboxes. The only thing missing is this check/unckeck behavior. I found this: check child nodes of a tree when a parent is clicked [ExtJS] , but it doesn't work for me because the the extjs API seems to be changed.

like image 661
alex Avatar asked Jul 05 '11 08:07

alex


1 Answers

I found a solution:

oncheckchange = function(node, checked, options){
    node.cascadeBy(function(n){n.set('checked', checked);} );
};

tree.on('checkchange', oncheckchange, null);
like image 92
alex Avatar answered Sep 24 '22 13:09

alex