PDA

View Full Version : Customizing tree node display



gireesh
10 Feb 2008, 10:37 PM
Hi,

Can some body please tell me how can I change the display of tree node ? I did make some change by extending NodeUI and override render method, I wanted some adjustment in the display area size, look at the attached screenshot. I wanted to put a 600px width for the text so that the icons doesn't come so close to the text.

Please help.

catacaustic
10 Feb 2008, 10:39 PM
I wouldn't do that as a standard tree. It will still work, but it's not a "great" way of it. Have a look at the examples for Column Trees (http://extjs.com/deploy/dev/examples/tree/column-tree.html). That way you can have the text fit whatever it needs to and have the icons all lining up properly out of the way of everything else.

gireesh
10 Feb 2008, 10:50 PM
Hi,

I thought of that approch, but the issue is, then all icons, irrespective of the child and parent will come in one column, I dont want that, I want the parent and child indentation for the icons also, It will be exactly same as the attached image, but with a 600px for the node text for all nodes.

catacaustic
11 Feb 2008, 2:20 PM
That should be easy enough to do then. I haven't tested this, but instead of just your text, use another element to block it out further.
<span width='600'>Your text in here</span>

6epcepk
12 Feb 2008, 2:41 AM
gireesh
Use iconCls attrbiute

gireesh
12 Feb 2008, 6:06 AM
gireesh
Use iconCls attrbiute

Can you please tell me how I can use this ?

catacaustic
12 Feb 2008, 2:14 PM
Use iconCls attrbiute
That only works for the icon itself. If you're going to use anything it'd be the cls option, not iconCls