I did the same in example tree.html and it doesn't have any effect either.<br><br><div class="gmail_quote">On Tue, May 3, 2011 at 10:16 AM, Yingqi Tang <span dir="ltr"><<a href="mailto:anakintang@gmail.com">anakintang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Andreas,<div><br></div><div>Thanks for information, but this approach doesn't seem to do for me. The dblclick handler set in baseAttrs is never triggered. </div>
<div><br></div><div>Thanks,</div><div>Yingqi<div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Tue, May 3, 2011 at 12:10 AM, Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
you can register the listener on every node that the loader creates.<br>
To do so, you have to configure a listeners object in the baseAttrs of<br>
the loader. See modification of your snippet inline:<br>
<div><br>
On Tue, May 3, 2011 at 7:20 AM, Yingqi Tang <<a href="mailto:anakintang@gmail.com" target="_blank">anakintang@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> In my GeoExt web app I have created a TreePanel, in which I have both a<br>
> BaseLayerContainer and OverlayLayerContainer as its children. This is the<br>
> JSON config:<br>
><br>
> layerTreeJsonConfig = [<br>
> { // baselayer container<br>
> nodeType: "gx_baselayercontainer",<br>
> text: 'basemap'<br>
> },<br>
> { // overlayer container<br>
> nodeType: "gx_overlaylayercontainer",<br>
> text: 'overlays',<br>
> expanded: false,<br>
> // render the nodes inside this container with a radio button,<br>
> // and assign them the group "overlayers".<br>
> loader: {<br>
> baseAttrs: {<br>
> radioGroup: "overlayers",<br>
> uiProvider: "layernodeui"<br>
<br>
</div> ,listeners: {dblclick: function() {/* do something */}}<br>
<br>
> }<br>
> }<br>
> }<br>
> ];<br>
<br>
Regards,<br>
Andreas.<br>
<div><br>
><br>
> I know and I was able to register "dblclick" listener on the TreePanel, now<br>
> my question is whether there is a way to register different event handler on<br>
> those two different layer container? The reason I am asking is that I am<br>
> trying to another custom layer container which inherits from<br>
> OverlayLayerContainer, and I would like wrap some event handler inside that<br>
> custom layer container instead of adding it on TreePanel for all.<br>
><br>
> Thanks.<br>
><br>
><br>
><br>
</div>> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@geoext.org" target="_blank">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>
<font color="#888888"><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>
</font></blockquote></div><br></div></div></div>
</blockquote></div><br>