[Users] Radio buttons in treeConfig
Robert Juan Francès
robert.juan at progess.com
Tue Jun 11 14:50:51 CEST 2013
Hi Steve, Raffaele and others, and thank you for your help.
What I'm trying to do is a classified tree of layers:
1- *Base Layers *(with radiobutton so only one is selectable at once)
2*-Overlayers*
2.1- Folder(*group 1 *a of overlayers)
Each layer with a check button to set its visibility, and a radiobutton to
set is its activate or not, so user can query its features.
2.2- Folder(*group 2* a of overlayers)
Each layer with a check button to set its visibility, and a radiobutton to
set is its activate or not, so user can query its features.
2.3-....
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?
*--------------------------------------------
*
*Abans d'imprimir aquest correu, pensi seriosament si necessita fer-ho.
Antes de imprimir este correo, piense seriamente si necesita hacerlo.
--------------------------------------------
*
*Aquest missatge electrònic està dirigit únicament a les adreces indicades.
El seu caràcter confidencial, personal i intransferible està protegit per
la Llei 15/99 de Protecció de Dades Personals. Qualsevol revelació, ús o
reenviament no autoritzat, total o parcial, està prohibit. Si ha rebut
aquest missatge per equivocació, notifiqui-ho immediatament a la persona
que l'ha enviat i esborri el missatge original conjuntament amb els seus
fitxers annexos sense llegir-lo ni gravar-lo.
Este mensaje electrónico está dirigido únicamente a las direcciones
indicadas. Su carácter confidencial, personal e intransferible, está
protegido por la Ley 15/99 de Protección de Datos Personales. Cualquier
revelación, uso o reenvío no autorizado, total o parcial, está prohibido.
Si ha recibido este mensaje por equivocación, notifíquelo inmediatamente a
la persona que se lo ha enviado, y borre el mensaje original conjuntamente
con los ficheros anexos sin leerlo ni grabarlo.*
2013/6/11 <Steve.Toutant at inspq.qc.ca>
>
> Do you mean for one layer you want a radio button AND a checkbox?
>
>
>
> *Raffaele Morelli <raffaele.morelli at gmail.com>@geoext.org*
> Envoyé par : users-bounces at geoext.org
>
> 2013-06-11 01:41
> A
> users at geoext.org
> cc
> Objet
> Re: [Users] Radio buttons in treeConfig
>
>
>
>
>
>
> 2013/6/10 Robert Juan Francès <*robert.juan at progess.com*<robert.juan at progess.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.
>
>
> I guess you would like check buttons for base layers, do you? If yes, why?
> Only one base layers can be active at once so there's no need for both.
>
> A radio button it's really useful for WMS feature request, when you
> usually want the request to retrieve only the active layer (ie. the one you
> choose with the radio button) information otherwise you get back all the
> visible layers (if configured of course).
>
> /r_______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20130611/0f925042/attachment.htm
More information about the Users
mailing list