-
4 Jun 2008 2:07 AM #1
populate a class to a node and all its children
populate a class to a node and all its children
Hi,
actually playing with tree Panel, i would like to apply a class style to a parent node (not a root) with its children... example : change the icon just for a branch.
for the case, i apply class to parent node (with getUI().addClass removeClass), and i browse each children to make the same...
If the tree is complex, it is a bad method...
any ideas ?
-
4 Jun 2008 2:10 AM #2
-
4 Jun 2008 2:14 AM #3
-
4 Jun 2008 4:05 AM #4
good usage of cascade ?
good usage of cascade ?
hello,
i got a parent node and i want to apply some operations upon all folder child of its hierarchie
here is what i do
node.cascade(function(node){
if ( ! node.isLeaf() ){
// some action here
}
}, node);
my problem is that the console.log show me the same node at each time...
good or bad use of cascade ?
-
4 Jun 2008 4:09 AM #5
Bad use of variable naming.
If you read the docs, the default scope of case is the current node:
Code:node.cascade(function() { console.log(this.id); } );
-
4 Jun 2008 4:12 AM #6


Reply With Quote
