<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi,<br><br>if you get all layers from same server then you can use a gx_layer as nodeType afaik.<br><br>Hope this helped a little.<br><br>best regards<br>Sarah<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;"></span></b><br></font><br>Hi,<br><br>The problem of this code is that selecting all layers in the <br>LayerContainer doesn't select the parent checkbox. Any idea?<br><br>Thanks<br>Julien<br><br>Julien-Samuel Lacroix wrote:<br>> Hi,<br>> <br>> I have a Tree with LayerContainers.I want to have a checkbox beside my <br>> directory that will allow me check/uncheck all the layers in my
<br>> LayerContainer in a single click.<br>> <br>> Here's how I do it. Maybe there's a better way, I may have miss something.<br>> <br>> {<br>> text: title,<br>> layerStore: mapPanel.layers,<br>> allowDrag: false,<br>> nodeType: 'gx_layercontainer',<br>> id: 'layercontainer_'+group,<br>> leaf: false,<br>> group: group,<br>> loader: {<br>> filter: function(record) {<br>> return record.get('layer').options.group == group;<br>> }<br>> },<br>> checked: false,<br>> listeners: {<br>> 'checkchange' : function(node, checked)<br>> {<br>> // If a parent node is unchecked, uncheck all the children<br>> if (node.getUI().isChecked()) {<br>>
node.expand();<br>> node.eachChild(function(child){<br>> child.ui.toggleCheck(true);<br>> });<br>> }<br>> if (!node.getUI().isChecked())<br>> {<br>> node.expand();<br>> node.eachChild(function(child) {<br>> child.ui.toggleCheck(false);<br>> });<br>> }<br>> }<br>> },<br>> [...snip...]<br>> }<br>> <br>> <br><br>-- <br>Julien-Samuel Lacroix<br>Mapgears<br><a href="http://www.mapgears.com/"
target="_blank">http://www.mapgears.com/</a><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@geoext.org" href="mailto:Users@geoext.org">Users@geoext.org</a><br><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br></div></div>
</div><br></body></html>