PDA

View Full Version : How to set icon in treegrid like in treepanel ?



alacenaire
19 Jun 2009, 1:38 AM
Hi,

I would like to know if it's possible to customize the icon
for the TreeGrid like the setIconProvider method in the TreePanel

I know the method TreeGrid.getStyle() to customize the icon but this way customize the same style for all the node.

Thanks.

alacenaire
19 Jun 2009, 3:49 AM
Ok seems the answer is the same as here :

http://extjs.com/forum/showthread.php?t=71507&highlight=treegrid

isn't ?

Thanks.

jadrake75
19 Jun 2009, 1:45 PM
Can't you simply call "setIconStyle()" or "setItemStyleName()" that refers to the css for the item from the TreeItems's in the tree?

The only thing that stinks here is you need to do it on the TreeItem's after there are associated (because they are wrapped), although in M3 they have changed this now....... (still you could also do this as a "on-expand" event as well (ie. only change the style beforeExpand so you are not doing the whole tree, only the tree that is viewed.