<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://337/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The function argument of cascade gets a node argument, use that in function f instead of LayerTree.<div><br></div><div>Alternatively, just loop over the layers and call setVisibility(false), the tree will update itself.</div><div><br></div><div>Best regards,</div><div>Bart</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>-- <br>Bart van den Eijnden<br>OpenGeo - <a href="http://opengeo.org/">http://opengeo.org</a><br>Expert service straight from the developers.</div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On Sep 5, 2012, at 8:36 AM, Jacinto Estima <<a href="mailto:jacinto.estima@gmail.com">jacinto.estima@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Hi,<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I am trying to develop a button to uncheck all the layers in my Ext.tree.TreePanel but without success so far.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Does anyone have ideas?<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I’m using the following code that I’ve found:<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">var</span></b><span style="font-size: 10pt; font-family: Consolas; "><span class="Apple-converted-space"> </span>unckeckAll =<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">new</span></b><span style="font-size: 10pt; font-family: Consolas; "><span class="Apple-converted-space"> </span>Ext.Button({</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> text:<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: Consolas; color: rgb(42, 0, 255); ">"Uncheck All"</span><span style="font-size: 10pt; font-family: Consolas; ">,</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> listeners:{</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> reset:<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">function</span></b><span style="font-size: 10pt; font-family: Consolas; "><span class="Apple-converted-space"> </span>(){</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> startNode =<span class="Apple-converted-space"> </span><span style="background-color: silver; background-position: initial initial; background-repeat: initial initial; ">LayerTree</span>.root;</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> <span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">var</span></b><span style="font-size: 10pt; font-family: Consolas; "><span class="Apple-converted-space"> </span>f =<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">function</span></b><span style="font-size: 10pt; font-family: Consolas; "><span class="Apple-converted-space"> </span>() {</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> <span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">if</span></b><span style="font-size: 10pt; font-family: Consolas; "><span class="Apple-converted-space"> </span>(<span style="background-color: silver; background-position: initial initial; background-repeat: initial initial; ">LayerTree</span>.attributes.checked) {</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> <span class="Apple-converted-space"> </span><span style="background-color: silver; background-position: initial initial; background-repeat: initial initial; ">LayerTree</span>.attributes.checked =<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">false</span></b><span style="font-size: 10pt; font-family: Consolas; ">;</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> <span class="Apple-converted-space"> </span><span style="background-color: silver; background-position: initial initial; background-repeat: initial initial; ">LayerTree</span>.getUI().toggleCheck(</span><b><span style="font-size: 10pt; font-family: Consolas; color: rgb(127, 0, 85); ">false</span></b><span style="font-size: 10pt; font-family: Consolas; ">);</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> }</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> };</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> startNode.cascade(f);</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> }</span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> } </span><span style="font-size: 10pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> });<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Consolas; "> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">Thanks,<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">Jacinto</span><o:p></o:p></div></div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@geoext.org" style="color: purple; text-decoration: underline; ">Users@geoext.org</a><br><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" style="color: purple; text-decoration: underline; ">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br></div></blockquote></div><br></div></body></html>