[Users] Additional checkboxes

Mehmet Sirin m.sirin07 at googlemail.com
Wed Jul 28 00:13:03 CEST 2010


Okay, got one solution. Now I'm able to chose several radiobuttons at
once. Also a radiobutton is unchecked if you click it again. If
someone aims the same: You have to remove name="', a.radioGroup,
'_radio"  in RadioButtonMixin.js. Then play with onClick method:
if(el) {
       if(!this.node.layer.myChecker){
            el.checked=true;
            this.node.layer.myChecker=true;
        }
    ...
with el.checked=true/false you can select/unselect the radiobutton.




>
> But even the basics of radio buttons does not work:
>

I had forgotten some basic things (because it is not in the LayerTree
tutorial on the Geoext homepage):

1. var LayerNodeUI = Ext.extend( GeoExt.tree.LayerNodeUI, new
GeoExt.tree.RadioButtonMixin() );
2. adding              baseAttrs: {radioGroup: "root",uiProvider:
"use_radio"} to loader of a LayerContainer

3. adding              applyLoader: false,
                           uiProviders: {
                                      "use_radio": LayerNodeUI
                           }   to loader of TreePanel.


Maybe a beginner need this..


regards
m.sirin


2010/7/27 Mehmet Sirin <m.sirin07 at googlemail.com>:
> Alternatively it would be perfect if I could chose multiple radio
> buttons at same time. Do you have an idea?
>
> But even the basics of radio buttons does not work:
>
>        var osm = new GeoExt.tree.LayerContainer({
>            text: 'OSM',
>            layerStore: mapPanel.layers,
>            leaf: false,
>            expanded: true,
>            nodeType:'gx_overlaylayercontainer',
>            loader: {
>                baseAttrs: {
>                radioGroup: "active"
>                 },
>
>                filter: function(record) {
>                    return
> record.get("layer").name.indexOf("Openstreetmap") !== -1
>                }
>            }
>
>        });
>
>
>        var layerTree = new Ext.tree.TreePanel({
>            title: 'Layer',
>            renderTo: 'layerTree',
>            root:{
>                     nodeType:'async',
>                     children:[osm,layerList],
>                     expanded:true,
>             },
>             loader: new Ext.tree.TreeLoader({
>                        applyLoader: false
>                      })
>        });
>
> No radio buttons are shown..why?
>
>
> thank you :)
> 2010/7/27 Mehmet Sirin <m.sirin07 at googlemail.com>:
>> Hi,
>> I want to have a second checkbox beside the first checkbox for each
>> layer. is that possible ? how would you do that?
>>
>>
>> regards
>>
>


More information about the Users mailing list