[Users] Problems begining with GeoExt

Andreas Hocevar ahocevar at opengeo.org
Wed Dec 1 09:52:31 CET 2010


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
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users

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



More information about the Users mailing list