Radio buttons in treeConfig

20 views
Skip to first unread message

Robert Juan Francès

unread,
Jun 10, 2013, 2:03:57 PM6/10/13
to geoext-use...@googlegroups.com
Hello everybody,

I'm working for the first time in GeoExt and there are some troubles that are killing me. My biggest problem is traying to make folders grouping some layers but including the check and the radio button (both at a same time) in those layers. I've seen lots of examples but none with the 2 controls.

I get the 2 controls but for all the overlayers, and what I want is to show the layers as I wish.


My code is:

var treeConfig = [{
        nodeType: 'async',
        text: "Estructura de capes",
        expanded: true,
children:[{
nodeType: "gx_baselayercontainer",
text: "Capes base"
},{
nodeType: 'gx_overlaylayercontainer',
text: "Capes d'informació",
loader: {
baseAttrs: {
radioGroup: "foo",
uiProvider: "layernodeui"
}  
}
}]
}];

I've tried to add the store object as follows, but nothing happens:

var storeDG = new GeoExt.data.LayerStore({
                 map: map,
                 initDir: 0,
                 layers: [diagnosis]
            });

and then:

var treeConfig = [{
        nodeType: 'async',
        text: "Estructura de capes",
        expanded: true,
children:[{
nodeType: "gx_baselayercontainer",
text: "Capes base"
},{
nodeType: 'gx_layer',
text: "Capes d'informació",
layerStore: storeDG,
loader: {
baseAttrs: {
radioGroup: "foo",
uiProvider: "layernodeui"
}  
}
}]
}];


But still no result.

So my last option has been to add a filter in the loader:

var treeConfig = [{
        nodeType: 'async',
        text: "Estructura de capes",
        expanded: true,
children:[{
nodeType: "gx_baselayercontainer",
text: "Capes base"
},{
nodeType: 'gx_layer',
text: "Capes d'informació",
layerStore: storeDG,
loader: {
filter: function (record) {
                                return record.getLayer("diagnosis").displayInLayerSwitcher == true
                                },
baseAttrs: {
radioGroup: "foo",
uiProvider: "layernodeui"
}  
}
}]
}];

But it didn't work either.

Any suggestion please?

Thanks in advance for your time and help.
Reply all
Reply to author
Forward
0 new messages