<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">Hi,</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">I want to disable treenode like in this webapp (http://www2.visdat.de/) look at "Freie Webdienste" which nicely disables treenodes after a certain resolution.</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">The relevant code is this....</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"
size="2">"</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><div>map.events.register('zoomend', map, function (e) {</div><div> if (map.getZoom() < minZoom) {</div><div> map.zoomTo(minZoom)</div><div> };</div><div> if (map.getZoom() > maxZoom) {</div><div> map.zoomTo(maxZoom)</div><div> }; </div><div> </div><div> for (var k = 0; k < layerArray.length; k++) {</div><div> var layerId = layerArray[k][8];</div><div>
if (layerTree.getNodeById(layerId)) {</div><div> if ((map.getResolution() >= layerArray[k][9] && map.getResolution() <= layerArray[k][10]) || (layerArray[k][9] == null && layerArray[k][10] == null)) {</div><div> layerTree.getNodeById(layerId).enable();</div><div> }</div><div> if (layerArray[k][9] != null && layerArray[k][10] != null) {</div><div> if (map.getResolution() <= layerArray[k][9] || map.getResolution() >= layerArray[k][10]) {</div><div>
layerTree.getNodeById(layerId).disable();</div><div> }</div><div> }</div><div> };</div><div> }</div><div> </div><div> </div></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">"</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">In my Application I wanted to disable a treenode when the zoomlevel goes above 12, but although api docs (</font><a
href="http://www.myext.cn/ext-3.2.1/docs/">http://www.myext.cn/ext-3.2.1/docs/</a>) <span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">say that a treenode has a disabled property, firebug says otherwise</span></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">According to the geoext docs (</font><a href="http://geoext.org/lib/GeoExt/widgets/tree/LayerNode.html">http://geoext.org/lib/GeoExt/widgets/tree/LayerNode.html</a>)</div><div><span class="Apple-style-span" style="line-height: 21px; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; "><font class="Apple-style-span" size="2">"</font></span><span class="Apple-style-span" style="line-height: 21px;
font-family: arial, helvetica, sans-serif; font-size: 13px; ">Configuration properties in addition to those listed for</span><span class="Apple-style-span" style="line-height: 21px; text-align: left; font-family: arial, helvetica, sans-serif; font-size: small; "> </span><a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.tree.TreeNode" style="line-height: 21px; text-align: left; font-family: arial, helvetica, sans-serif; color: rgb(202, 121, 0); font-size: 13px; ">Ext.tree.TreeNode</a><span class="Apple-style-span" style="line-height: 21px; text-align: left; font-family: arial, helvetica, sans-serif; font-size: 13px; ">."</span><br></div><div><span class="Apple-style-span" style="line-height: 21px; text-align: left; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="line-height: 21px; text-align: left; font-family: arial, helvetica, sans-serif;
font-size: 13px; ">So I looked at the </span><a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.tree.TreeNode" style="color: rgb(202, 121, 0); line-height: 21px; text-align: left; font-family: arial, helvetica, sans-serif; font-size: 13px; ">Ext.tree.TreeNod</a><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-style-span" style="line-height: 21px;"> propertie and saw this...</span></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-style-span" style="line-height: 21px;"><br></span></font></div><div><b style="font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; "><a href="http://www.myext.cn/ext-3.2.1/docs/source/TreeNode.html#cfg-Ext.tree.TreeNode-disabled" style="color: rgb(8, 55, 114); text-decoration: none; ">disabled</a></b><span class="Apple-style-span" style="font-family:
Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; "> : Boolean</span><div class="mdesc" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(68, 68, 68); font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; ">true to start the node disabled</div><div class="mdesc" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(68, 68, 68); font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; "><br></div><div class="mdesc" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(68, 68, 68); font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 13px; ">So, I tried this...</div><div class="mdesc" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(68, 68, 68); font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; "><br></div></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><div>map.events.on({</div><div> "zoomend": function (e) {</div><div> if (this.getZoom() > 12) {</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> layer_1.setVisibility(true);</div><div> layer_1.disabled="false";</div><div><br></div><div><br></div><div><br></div><div>
} else {</div><div> layer_1.setVisibility(false);</div><div> layer_1.disabled="true";</div><div> </div><div> var mapcenter = getMapCenter();</div><div> </div><div><br></div><div> }</div><div> }</div><div> });</div><div><br></div><div>and my console reports "<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 12px; white-space: pre-wrap; ">has no method 'disable'"<span class="Apple-tab-span" style="white-space:pre">        </span></span></div><div>The setVisibility(true); works ok, but this
method isnīt even documented!</div><div><br></div><div>I am not a javaascript guru unfortunately, but I thought I could understand the docs...now iīm not too sure.</div><div><br></div><div>Thanks for any help,</div><div><br></div><div>Rob</div><div><br></div><div><br></div><div><br></div></font></div></div></div></body></html>