<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Hi,</div><div><br></div><div>I would be very interested in seeing all of the code for the project, if you don´t mind of course.</div><div><br></div><div>I am also having various problems with tree structures and understanding how the code works and find the examples from other projects very useful,</div><div><br></div><div>Either a link to the project online or pasted code would be great,</div><div><br></div><div>Yours,</div><div><br></div><div>Rob</div><div><br></div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> brad <brad@numaps.com.au><br><b><span style="font-weight: bold;">An:</span></b> brad
<brad@numaps.com.au>; Andreas Hocevar <ahocevar@opengeo.org><br><b><span style="font-weight: bold;">CC:</span></b> users@geoext.org<br><b><span style="font-weight: bold;">Gesendet:</span></b> Montag, den 11. Juli 2011, 2:13:15 Uhr<br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [Users] GeoExt.tree problem<br></font><br>Sorted!<br><br>Well just in case anyone else wants to do this ......<br><br>Instead of using Ext.get(layer.name).setIconCls('loading'); in my loadstart<br>event, I used<br><br>controlPanels.tree.getNodeById(layer.name).setIconCls('loading');<br><br>You just have to check that the tree node has been opened before using it.<br><br>Thanks Andreas you got me on the right track!<br><br>Cheers,<br><br>Brad....<br><br>-----Original Message-----<br>From: <a ymailto="mailto:users-bounces@geoext.org" href="mailto:users-bounces@geoext.org">users-bounces@geoext.org</a> [mailto:<a ymailto="mailto:users-bounces@geoext.org"
href="mailto:users-bounces@geoext.org">users-bounces@geoext.org</a>] On Behalf<br>Of brad<br>Sent: Monday, 11 July 2011 1:08 AM<br>To: 'Andreas Hocevar'<br>Cc: <a ymailto="mailto:users@geoext.org" href="mailto:users@geoext.org">users@geoext.org</a><br>Subject: Re: [Users] GeoExt.tree problem<br><br>Andreas,<br><br>Still not quite there mate!<br><br>I noticed that Ext 3.2.1 did not support setIconCls so had to load Ext<br>3.3.1. I have been able to get the setIconCls to work. But I am a little<br>confused as to what goes where.<br> <br>This is my listener that is on the tree - it passes the tree node object<br>thru to the listener. <br><br>"checkchange": function(node){setTheForecastLayers(node)<br><br>Within this listener I can change the icon class simply by doing<br>node.setIconClass('loading'). That proved that if I have the node object I<br>can change its image class. Obviously that is not what I want - that was<br>just a test. <br><br>When I load
the layer I register the loading events with the following where<br>layer is the layer object created in OL.<br><br>// ----- layer loading events ----- //<br>function registerEvents(layer) <br>{ <br> if(layer.name != '' && layer.name != null && !layer.isBaseLayer)<br> {<br> layer.events.register("loadstart", layer, function() <br> {<br> if (layersLoading == 0) <br> { <br> eventsLog.style.display='block'; <br> }<br> layersLoading++;<br>
});<br> layer.events.register("loadend", layer, function() <br> {<br> layersLoading--;<br> if (layersLoading == 0) <br> { <br> eventsLog.style.display='none';<br> }<br> });<br> }<br>} <br><br>The problem I have is how to change the iconCls of the node. I thought that<br>if I made the id of the node the same as the layer.name of the layer that I<br>could do the following inside these events instead of the changing the<br>display of the all layers loading icon 'eventsLog'.
<br><br>Ext.get(layer.name).setIconCls('loading');<br><br>However, the error I get is that Ext.get(layer.name) is null yet I know that<br>the node has the correct id as I can alert that in the checkbox listener.<br><br>So I must be doing something wrong here? Any ideas?<br><br>Cheers, Brad....<br><br><br> <br><br><br><br><br><br><br><br><br>-----Original Message-----<br>From: Andreas Hocevar [mailto:<a ymailto="mailto:ahocevar@opengeo.org" href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>] <br>Sent: Friday, 8 July 2011 8:21 PM<br>To: brad<br>Cc: <a ymailto="mailto:users@geoext.org" href="mailto:users@geoext.org">users@geoext.org</a><br>Subject: Re: [Users] GeoExt.tree problem<br><br>Hi,<br><br>the Ext.tree.TreeNode has a setIconCls method. This should get you there.<br><br>Andreas.<br><br>On Fri, Jul 8, 2011 at 12:00 PM, brad <<a ymailto="mailto:brad@numaps.com.au" href="mailto:brad@numaps.com.au">brad@numaps.com.au</a>> wrote:<br>>
Andreas,<br>><br>> Ok I understand. I currently have a loader wheel running using<br>> loadstart/loadend but I would like to control the icon at the tree node. I<br>> have found that you can change the default image at the node level with<br>> iconCls: 'my image class'. However, I can't figure out how to change the<br>> className under program control.<br>><br>> For example, I can place a listener on the treePanel which allows me to<br>> interrogate the node selected ('checkchange':function(node)(...)) whenever<br>a<br>> checkbox is clicked. However, inside this function when I look at the<br>node's<br>> iconCls its 'undefined' and yet there is an iconCls set for each node in<br>the<br>> tree - either the default one or one that I set. So without access to the<br>> iconCls for a node I can't see how I can use the loadstart/Loadend to<br>> control the node's image className?<br>><br>> There must be
something I'm missing here???<br>><br>> Cheers, Brad....<br>><br>> -----Original Message-----<br>> From: <a ymailto="mailto:andreas.hocevar@gmail.com" href="mailto:andreas.hocevar@gmail.com">andreas.hocevar@gmail.com</a> [mailto:<a ymailto="mailto:andreas.hocevar@gmail.com" href="mailto:andreas.hocevar@gmail.com">andreas.hocevar@gmail.com</a>] On<br>Behalf<br>> Of Andreas Hocevar<br>> Sent: Friday, 8 July 2011 5:15 PM<br>> To: brad<br>> Cc: <a ymailto="mailto:users@geoext.org" href="mailto:users@geoext.org">users@geoext.org</a><br>> Subject: Re: [Users] GeoExt.tree problem<br>><br>> Hi,<br>><br>> there is no way to get this loading throbber with just GeoExt. The<br>> JSON tree loader in GeoExt has this throbber, spinning until the JSON<br>> response is turned into layer nodes.<br>><br>> It is, however, possible to achieve this on the application level by<br>> registering for the OpenLayers Map's
loadstart and loadend events.<br>><br>> Andreas.<br>><br>> On Fri, Jul 8, 2011 at 7:50 AM, brad <<a ymailto="mailto:brad@numaps.com.au" href="mailto:brad@numaps.com.au">brad@numaps.com.au</a>> wrote:<br>>> List,<br>>><br>>><br>>><br>>> I have seen GeoExt apps that have a small animated gif spin on the layer<br>>> nodes. I cannot see how to activate this. The examples also do not have<br>>> spinning layer load wheels? Is there something i need to configure to get<br>>> this load wheel operating.<br>>><br>>><br>>><br>>> My nodes look like this:<br>>><br>>><br>>><br>>> nodeType: "gx_layer",<br>>><br>>> layer : “layer 1”,<br>>><br>>>
text : “my layer name”,<br>>><br>>> isLeaf : true,<br>>><br>>> disabled : false<br>>><br>>><br>>><br>>> Cheers,<br>>><br>>><br>>><br>>> Brad....<br>>><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>>><br>>><br>><br>><br>><br>>
--<br>> Andreas Hocevar<br>> OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>> Expert service straight from the developers.<br>><br>><br>><br><br><br><br>-- <br>Andreas Hocevar<br>OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>Expert service straight from the developers.<br><br><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><br><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 style="position:fixed"></div>
</div></body></html>