tree recursive check/uncheck

hi there,
is there a way to simulate a recursive check/uncheck of a tree branch ?
I did some tests with checkall and uncheckall and there seems to be some infinite loops being triggered.
so far the only way I could make it work was like this :
$$(“tree”).attachEvent(“onItemClick”,function(id,e,node){ if ($$(“tree”).isChecked(id)) { $$(“tree”).uncheckAll(id); } else { $$(“tree”).checkAll(id); } } );
but it doesn’t work with ‘onItemCheck’
any clues ?
thank you for the support and that wonderful piece of code !

Please check the next sample
http://webix.com/snippet/199ac1c1

The solution that you you are using is correct. It changes state of all sub items and it does trigger onItemCheck event for all envolved items.

If you have some issue - please provide a snippet or a demo link where it can be checked.