Home > JavaScript > Extjs4 tree (un)check all children

Extjs4 tree (un)check all children

October 20th, 2014 Leave a comment Go to comments

If you use Extjs treePanel with checkbox to select elements, here’s the solution how to check/decheck all tree elements.

Example for check:

Ext.getCmp('tree-list').getRootNode().cascade(function(n) 
{
    n.set("checked",true); 
});

Example for uncheck:

Ext.getCmp('tree-list').getRootNode().cascade(function(n) 
{
    n.set("checked",false); 
});
Categories: JavaScript Tags: ,
  1. No comments yet.
  1. No trackbacks yet.