PDA

View Full Version : Set tree panel node checked, programmatically



bwilson
24 May 2012, 5:38 AM
I have a treepanel with checkboxes enabled on the nodes ("checked" config specified on each node). How do I set a node to be checked dynamically, from Javascript, as I'm doing a cascadeBy()?

I found this posted in some forums and blogs:



rootNode.cascadeBy(function(node) {
node.getUI().toggleCheck(true);
}


...but in ExtJS 4 it seems like the getUI() method doesn't exist (can't see it on 'node' in firebug, an exception throws me out of the cascadeBy() when that line is hit.

FoxMulder900
24 May 2012, 10:37 AM
Try this:


node.set('checked',true);