<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#ffffff" text="#333333">
Hi all,<br>
<br>
until now I only used OpenLayers and GeoExt with the experience
gained from several tutoials ;)<br>
I created MapPanels and LayerTrees like this...<br>
<pre><span class="nx">root</span><span class="o">:</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">LayerContainer</span><span class="p">({</span>
<span class="nx">layerStore</span><span class="o">:</span> <span class="nx">mapPanel</span><span class="p">.</span><span class="nx">layers</span><span class="p">,</span>
<span class="nx">expanded</span><span class="o">:</span> <span class="kc">true</span>
<span class="p">}),
</span></pre>
<br>
Now I tried to define a customized layerlist with sublayers and make
them visible in map onClick:<br>
<br>
<pre>var layerList =[{ </pre>
<pre> "text":"Land use",</pre>
<pre> "children":[{</pre>
<pre> "nodeType":"gx_layer",</pre>
<pre> "layer":"wms"</pre>
<pre> },{</pre>
<pre> "nodeType":"gx_layer",</pre>
<pre> "layer":"MAS"</pre>
<pre> },{</pre>
<pre> "nodeType":"gx_layer",</pre>
<pre> "layer":"MRS"</pre>
<pre> }] </pre>
<pre> },{</pre>
<pre> "text":"Air quality and health",</pre>
<pre> "children":[{</pre>
<pre> "nodeType":"gx_layer",</pre>
<pre> "layer":"wms2"</pre>
<pre> },{</pre>
<pre> "nodeType":"gx_layer",</pre>
<pre> "layer":"GMAS"</pre>
<pre> },{</pre>
<pre> "nodeType":"gx_layer",</pre>
<pre> "layer":"MRS"</pre>
<pre> }] </pre>
<pre> }] ;
var tree = new Ext.tree.TreePanel({
                region:                'west',
                title:                 "Layers",
                width:                 200,
                autoScroll:         true,
                enableDD:         true,
                lines:                 false,        
        loader:         new Ext.tree.TreeLoader({
                                applyLoader: false
                        }),
        root:                 {
                                        children: layerList
                                 },
        rootVisible:         true
                });
</pre>
But only <i>root</i> and the first node are visible in LayerTree.
The nodes are not expandable. <br>
What is missing in this definition?<br>
<br>
The error message in Firebug shows:<br>
<span role="presentation" class="objectBox objectBox-errorMessage
hasBreakSwitch ">this.node.layer.getVisibility is not a function</span><br>
<br>
<br>
Best regards,<br>
Christian<br>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>