<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Yingqi,<br>
<br>
you could use the defaults property of the LegendPanel:<br>
<br>
var legendPanel = new GeoExt.LegendPanel({<br>
defaults: {<br>
labelCls: 'legendpanel-layername',<br>
style: 'padding:5px',<br>
clickableSymbol: true,<br>
clickableTitle: true,<br>
selectOnClick: true,<br>
listeners: {<br>
symbolclick: function(comp, rule){
alert('symbolclick'); },<br>
titleclick: function(comp, rule){ alert('titleclick');
},<br>
ruleclick: function(comp, rule){ alert('ruleclick'); },<br>
ruleselected: function(comp, rule){
alert('ruleselected'); }<br>
}<br>
},<br>
autoScroll: true<br>
});<br>
<br>
Regards,<br>
<br>
Marc<br>
<br>
<br>
<br>
On 24.08.2010 01:58, Yingqi Tang wrote:
<blockquote
cite="mid:AANLkTik=dB-GGSC9XZFUgC3b895e2L2FtLHuuHJH-_tT@mail.gmail.com"
type="cite">Hi,<br>
<br>
Is there any example or doc demonstrating how to add event listener to
legend entry of GeoExt legend panel? For example, I saw in the source
code of VectorLegend.js there are events like "titleclick",
"symbolclick", ...etc. and I assume that's where you can add callback
when a legend title or symbol is clicked. The existing example only
shows how to add a legend panel so it's not obvious to me how to add
event listener through LegendPanel? <br>
<br>
Does one have to create legend using VectorLegend directly to
manipulate those events?<br>
<br>
Thanks<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@geoext.org">Users@geoext.org</a>
<a class="moz-txt-link-freetext" href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
.................................................................
Karten im (Inter|Intra)net?
OpenLayers - Webentwicklung mit dynamischen Karten und Geodaten
von M. Jansen und T. Adams, OpenSourcePress, München.
ISBN: 978-3-937514-92-5
URL: <a class="moz-txt-link-freetext" href="http://openlayers-buch.de">http://openlayers-buch.de</a>
.................................................................
Dipl.-Geogr. Marc Jansen
- Anwendungsentwickler -
terrestris GmbH & Co. KG
Irmintrudisstraße 17
53111 Bonn
Tel: ++49 (0)228 / 96 28 99 -53
Fax: ++49 (0)228 / 96 28 99 -57
Email: <a class="moz-txt-link-abbreviated" href="mailto:jansen@terrestris.de">jansen@terrestris.de</a>
Web: <a class="moz-txt-link-freetext" href="http://www.terrestris.de">http://www.terrestris.de</a>
Amtsgericht Bonn, HRA 6835
Komplementärin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams
</pre>
</body>
</html>