[Users] Fwd: Tree Node with Radio Button

Andreas Hocevar ahocevar at opengeo.org
Mon Apr 4 12:30:54 CEST 2011


Hi,

a LayerNode should not have a loader. Either you configure a container node (Ext.tree.Node) with a loader, or you configure individual layer nodes (GeoExt.tree.LayerNode) with attributes. In the latter case, instead of

loader: {
    baseAttrs: {
        radioGroup: 'theme'
        uiProvider: 'layernodeui'
    }
}

you would just configure

radioGroup: 'theme',
uiProvider: 'layernodeui'

For testing, you can also remove the uiProvider config option.

Regards,
Andreas.

On Apr 4, 2011, at 11:45 , Hugo wrote:

> Hello all,
> 
> I'm still struggling with this... Until the moment i had no success on rendering a GeoExt.tree.LayerNode with the radio button plugin. My definition of the layer node is the following:
> 
> var sessao2LayerNode = new GeoExt.tree.LayerNode({
>     layer: ppsessao2,
>     leaf: true,
>     loader: {
>        baseAttrs: {
>           radioGroup: 'theme',
>           uiProvider: 'layernodeui'
>        }
>     }
> });
> 
> Nevertheless, when i add this node to the tree it is rendered with the checkbox only. What am i doing wrong here?
> 
> Thanks.
> Kind regards,
> 
> Hugo
> 
> 
> 
> 
> ---------- Forwarded message ----------
> From: Hugo <hfpmartins at gmail.com>
> Date: Wed, Mar 30, 2011 at 5:56 PM
> Subject: Tree Node with children using Radio Button plugin
> To: users at geoext.org
> 
> 
> Hello all,
> 
> Is it possible to have a parent node with children rendered with and without RadioButton? I need to include two layers inside the same parent node but i would like to have one of them rendered with a radio button an the other without the radiobutton (just with the checkbox). The relevant part of code i'm using is as follows:
> 
> var LayerNodeUI = Ext.extend(GeoExt.tree.LayerNodeUI, new GeoExt.tree.TreeNodeUIEventMixin());
> 
> var sessao2LayerNode = new GeoExt.tree.LayerNode({
>     layer: ppsessao2,
>     leaf: true,
>     loader: {
>        baseAttrs: {
>           radioGroup: 'theme',
>           uiProvider: 'layernodeui'
>        }
>     }
> });
>             
> var forunspp = new GeoExt.tree.LayerNode({
>     layer: locaisPP
> });
> 
> var session2Node = new Ext.tree.TreeNode({
>     text: '2º Fórum',
>      id: 'session2node',
>      expanded: false,
>      expandable: true
> });
> 
> var layerRoot = new Ext.tree.TreeNode({});
> 
> var layerTree = new Ext.tree.TreePanel({
>      title: 'Temas',
>      layout: 'fit',
>      root: layerRoot,
>      rootVisible: false,
>      loader: new Ext.tree.TreeLoader({applyloader: false}),
>      enableDD: false,
>      autoScroll: true,
>      expanded: true,
>      border: true,
>      plugins: [
>           new GeoExt.plugins.TreeNodeRadioButton({
>                listeners: {
>                     'radiochange': function(node) {}
>                 }
>            })
>      ],
>      loader: new Ext.tree.TreeLoader({
>           applyLoader: false,
>           uiProviders: {
>                'layernodeui': LayerNodeUI
>           }
>      })
> });
> 
> layerRoot.appendChild(forunspp);
> layerRoot.appendChild(sessao2LayerNode);
> 
> With this code the parent node is filled with two layers but, however, both of them are rendered with the checkbox only.
> Is it possible to load the second and only the second layer with a radio button? 
> Thanks in advance.
> 
> Kind regards,
> Hugo
> 
> 
> -- 
> Hugo Martins
> LabNT - ISEGI UNL
> Campus de Campolide
> 1070-312 Lisboa
> N 38°43'56.84", W 9°9'35.74"
> 
> 
> 
> -- 
> 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



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



More information about the Users mailing list