[Users] ExtJs Create Radio Button Tree Nodes
Andreas Hocevar
ahocevar at opengeo.org
Wed Nov 24 16:06:22 CET 2010
Sorry, it's neither group nor radioGroup, it is checkedGroup. I have to add this to the api docs.
Regards,
Andreas.
On Nov 24, 2010, at 15:57 , IT Intern wrote:
> Dear Andreas,
>
> Thank you for your quick reply. I tried assigning the overlay container with a loader group and it is not working for me still :(
>
> function childContainerRadioButtons(text, layerStore, parent, iconCls){
>
> parent.appendChild(new GeoExt.tree.OverlayLayerContainer({
> text: text,
> layerStore: layerStore,
> expanded: true,
> iconCls: iconCls, //If not specified, defaults to original image
> loader:{
> baseAttrs:{
> radioGroup: "foo"
> }
> }
> }));
>
> }//end childContainerRadioButtons
>
> I tried group: "foo" also..as for what was I expecting the loader to do with {param: "LAYERS"}, thats a good question...for some reason I thought I needed that...
>
> If anyone might know why is still isn't working for me, please drop me a hint ;)
>
> Thank you for your time,
>
> elshae
>
> On Wed, Nov 24, 2010 at 2:59 AM, Andreas Hocevar <ahocevar at opengeo.org> wrote:
> Hi,
>
> On Nov 23, 2010, at 22:01 , IT Intern wrote:
>
> > Hello GeoExt users,
> >
> > I have an Ext.tree.TreePanel that I later add a layer to one of it's child containers after that container has been created. The child container is an GeoExt.tree.OverlayLayerContainer. The two things that I am struggling with are how to set the tree nodes of an GeoExt.tree.OverlayLayerContainer to radio buttons instead of checkboxes?
>
> Configure the nodes with a group attribute. Then you will get a radio button instead of a checkbox, which will also make the checked layer mutually exclusive:
>
> loader: {
> baseAttrs: {group: "foo"}
> }
>
> > and how do I add nodes later on to the container?
>
> The OverlayLayerContainer is synchronized with the map's layers. No need to add nodes manually.
>
>
> > My attempt at this is below:
> >
> > function childContainer(text, layerStore, parent, iconCls){
> >
> >
> > parent.appendChild(new GeoExt.tree.OverlayLayerContainer({
> >
> > text
> > : text,
> > layerStore: layerStore,
> >
> > expanded
> > : true,
> > iconCls: iconCls, //If not specified, defaults to original image
> >
> > loader
> > : {param: "LAYERS"}
>
> What are you expecting this loader to do? The OverlayLayerContainer uses a LayerLoader, which has no param config option.
>
> Regards,
> Andreas.
>
> >
> >
> > }));
> >
> > }//end childContainer
> >
> > //Container for photo layers
> >
> > childContainer
> > ("Photo Layers", photoLayers, layerRoot);
> >
> >
> > //In another function
> > map.addLayer(vectorPano);
> >
> >
> > layerStore.loadData([vectorPano], true);
> >
> >
> > var panoNode = new Ext.tree.TreeNode({
> >
> > leaf
> > : true,
> > text: 'Panoramio Photos',
> >
> >
> > checked: false
> >
> > });
> >
> > panoNode
> > .addListener("radiochange", function(){
> >
> > vectorPano
> > .setVisibility(true);
> > });
> >
> >
> > var layerContainer = layerRoot.findChild('text', 'Photo Layers');
> >
> > layerContainer
> > .appendChild(panoNode);
> > Currently a node is added, but it is a checkbox and when it is clicked on and off it does not turn the layer on/off. I'd prefer radio buttons nodes..
> >
> > Thank you for your time,
> >
> > elshae
> >
> >
> > _______________________________________________
> > 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.
>
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
>
>
> _______________________________________________
> 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