PDA

View Full Version : Change Tree Node style after load



Albareto
3 Jul 2012, 6:44 AM
Hi there,

I have been looking around in the Internet but I could not find an answer for this. How can I add/remove a stylesheet class to a node in the tree store's load event?

In Ext 3 I used to do just this:


load : function(store, node){
node.getUI().addClass('myClass');
}

but now the NodeInterface class does not provide with anything like that, so what's the way of doing it?

I have also seen a question (http://www.sencha.com/forum/showthread.php?134568-Why-not-find-treeNode-getUI%28%29-methdo-in-extjs4.x) regarding why the getUi method was removed but nobody has answered.

Well, any help is really appreciated.

Cheers

droessner
3 Jul 2012, 11:06 AM
Try node.set('iconCls', 'myClass');

Albareto
3 Jul 2012, 10:38 PM
Thanks dude! That worked. In my case was:


node.set('cls', 'myClass');