PDA

View Full Version : question about treepanel node



bureau
6 Mar 2012, 7:06 AM
Hello everybody
I want to add some classes to some node into a treepanel, and i don't know if it's possible.


Can someone help me ?

thank

mitchellsimoens
6 Mar 2012, 7:35 AM
Ext JS 1, Ext JS 2, Ext JS 3 or Ext JS 4?

bureau
6 Mar 2012, 9:14 AM
sorry,
ExtJs 4

mitchellsimoens
6 Mar 2012, 9:17 AM
Moved to Ext JS 4 Q&A forum

bureau
6 Mar 2012, 11:16 PM
Nobody know ??

vietits
7 Mar 2012, 5:27 AM
What do you mean 'add some classes to some node' ? Do you mean CSS classes? If so you should use <node>.set('cls', 'your css class').

bureau
7 Mar 2012, 6:03 AM
it doesn't work.
When i add a class style to my node, nothing change in the interface..

I forgot, i fill my treestore with a proxy like:
proxy:{
url: .....php ,
type: 'ajax'
}

And in the php i make an "echo" like
echo {"text":"....","leaf":true,"iconCls":"...","href":"","id":"...","cls":".."}

And this class is not applicated to anyone node created

vietits
7 Mar 2012, 6:32 AM
Do you check your node with 'Inspect Element' tool?

bureau
7 Mar 2012, 6:45 AM
yes, with google chrome.
And this class which was add is present in node.data.cls, but it's not applicate to this node

vietits
7 Mar 2012, 7:00 AM
What do you expect when applying class to your node? Let do a test to check

1. Add CSS class definition


.myclass {
color: red;
font-weight: bold !important;
}


2. Set 'myclass' to your node. What do you see?


<your node>.set('cls', 'myclass');

bureau
7 Mar 2012, 11:06 PM
problem solved !! I had forgotten "!important" in my css class ..
Thanks a lot !