[Users] GeoExt LayerContainer with checkbox
Sarah Schuessler
sarah_flip at yahoo.de
Tue Jun 8 16:37:57 CEST 2010
Hi,
if you get all layers from same server then you can use a gx_layer as nodeType afaik.
Hope this helped a little.
best regards
Sarah
________________________________
Hi,
The problem of this code is that selecting all layers in the
LayerContainer doesn't select the parent checkbox. Any idea?
Thanks
Julien
Julien-Samuel Lacroix wrote:
> Hi,
>
> I have a Tree with LayerContainers.I want to have a checkbox beside my
> directory that will allow me check/uncheck all the layers in my
> LayerContainer in a single click.
>
> Here's how I do it. Maybe there's a better way, I may have miss something.
>
> {
> text: title,
> layerStore: mapPanel.layers,
> allowDrag: false,
> nodeType: 'gx_layercontainer',
> id: 'layercontainer_'+group,
> leaf: false,
> group: group,
> loader: {
> filter: function(record) {
> return record.get('layer').options.group == group;
> }
> },
> checked: false,
> listeners: {
> 'checkchange' : function(node, checked)
> {
> // If a parent node is unchecked, uncheck all the children
> if (node.getUI().isChecked()) {
> node.expand();
> node.eachChild(function(child){
> child.ui.toggleCheck(true);
> });
> }
> if (!node.getUI().isChecked())
> {
> node.expand();
> node.eachChild(function(child) {
> child.ui.toggleCheck(false);
> });
> }
> }
> },
> [...snip...]
> }
>
>
--
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/
_______________________________________________
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/20100608/1bd52dc1/attachment.htm
More information about the Users
mailing list