[Users] GeoExt Legend Tree , child node expanded

karsten karsten at terragis.net
Tue May 22 08:58:28 CEST 2012


Hi all,
 
below I have a Ext.tree.TreePanel with legend in child nodes (code below). I
m trying to have all legend image snot expanded (shown) when the layers is
not checked on initial loading of the map e.g. but I could not figure out
how to achieve this. So far I tried to put 
expanded: false,
all over the place to no avail.
Any hints how I can get this working ?
 
Cheers
Karsten
...
{nodeType: "gx_layercontainer",
        text: 'Kartendaten',
        layerStore: mapPanel.layers,
        expanded: false,
        loader: {
            filter: function(record) {  
               return record.get("layer").group == "Kartendaten";//
this.group; 
            },
            baseAttrs: {
                uiProvider: "custom_ui",
            },
            createNode: function(attr) {
                 // add a WMS legend to each node created
                 if(attr.layer instanceof OpenLayers.Layer.WMS &&
                    attr.layer.url.indexOf('tilecache') > 0) {
                     attr.component = {
                         xtype: "gx_legendimage",
                         url:
"/proxy/gotomaplegend.cgi?TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST
=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&FORMAT=image%2Fgif
&LAYER="+attr.layer.params.LAYERS.substr(7),
                         cls: "legend",
                     };
                 } else {
                     attr.component = {
                         xtype: "gx_wmslegend",
                         layerRecord:
mapPanel.layers.getByLayer(attr.layer),
                         showTitle: false,
                         cls: "legend",
                     };
                 }
                 return
GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr); 
            }                                        
        }    
    }
...
 

 





=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 9.0.0.888, Virus/Spyware Database: 6.19680)
http://www.pctools.com/
=======
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120521/7986f6ed/attachment.htm 


More information about the Users mailing list