[Users] How to change icon of a tree node inside a container

Bart van den Eijnden bartvde at osgis.nl
Thu Feb 17 12:42:52 CET 2011


Hi,

something similar is done in GXP, checkout:

https://github.com/opengeo/gxp/blob/master/src/script/plugins/LayerTree.js

and search for iconCls.

Best regards,
Bart

-- 
Looking for flexible support on OpenLayers or GeoExt? Please check out http://www.osgis.nl/support.html

Bart van den Eijnden
OSGIS
bartvde at osgis.nl

On Feb 17, 2011, at 12:34 PM, Hugo wrote:

> Hello all,
> 
> I'm trying to change the default ExtJS icons of tree nodes that are inside a container but, until the moment, with no success. So, i have a GeoExt.tree.LayerContainer with 3 layers. I'm able to change the parent node icon through the config option iconCls. However, this is not working with the child nodes od this layer container. I've tried the following:
> 
> //my container
> var baseStreetCont = new GeoExt.tree.BaseLayerContainer({
>       text: 'Arruamentos',
>       layerStore: baseLayerStore,
>       expanded: true,
>       allowDrop: false
> });
> 
> baseStreetCont.eachChild(function(node){
>      node.attributes.iconCls = 'raster';
> });
> 
> I've also tried:
> 
> var treePanel (my tree panel configurations)
> 
> treePanel.getLoader().on('beforeload', function(loader, node){
>        node.eachChild(function(node){
>             node.attributes.iconCls = 'raster';
>        }, loader);
> });
> 
> Any suggestions?
> Thanks,
> Hugo
> 
> -- 
> Hugo Martins
> LabNT - ISEGI UNL
> Campus de Campolide
> 1070-312 Lisboa
> N 38°43'56.84", W 9°9'35.74"
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list