On Nov 30, 2010, at 14:40 , Vidal, Antoni wrote:

> Hello list,
>  
> I’m new on GeoExt, and I’m trying to create a custom layers tree menu 
> grouping baselayers and overlays layers in diferent folders.
>  
> I tryed with this code:
>  
> var treeConfig = [{
>                                 nodeType: "gx_baselayercontainer"
> }, {
>                                nodeType: "gx_overlaylayercontainer",
> expanded: true
>                 }];
>  
> .....
> Inside Ext.Viewport:
>  
>  
> items: [{
>                                     title: 'Capes',
>                                     xtype: "treepanel",
>                                     loader: new Ext.tree.TreeLoader({
>                                     applyLoader: false
>                                     }),
>                                     root: {
>                                         nodeType: "gx_layercontainer",

Change to
nodeType: "async"

>                                       children: Ext.decode(treeConfig)

Change to
children: treeConfig

>                                   }
>                 }
>  
>  
> It doesn’t work.
>  
> Any idea or example would be appreciate.

I finally changed the http://dev.geoext.org/trunk/geoext/examples/tree.html 
example to explain that neither "new OpenLayers.Format.JSON().write" nor 
"Ext.decode" should be used in applications. This is just there because the 
example allows live modification of the tree configuration with the "Show/Edit 
Tree Config" button.

Regards,
Andreas.

>  
> Thank’s a lot.
>  
> Antoni Vidal
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>  
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to