<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Hi Viola,</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">yes..it took a while for me too.</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">In my example the tree nodes hold the context menu...</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">In my example underneath, I have a context menu holding a
"<span class="Apple-style-span" style="font-size: small; ">Zoom to Layer Extent" button and the Metadata window.</span></div><div style="color: black; font-family: arial, helvetica, sans-serif; "><font class="Apple-style-span" size="2"><br></font></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">A test version is here <span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; "><a href="http://maps.zgb.de/www/zgb_energie/geodatenportal.html">http://maps.zgb.de/www/zgb_energie/geodatenportal.html</a></span></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">It could probably do with some tweaking though. For some reason the layers added dynamically to the tree could never be queried. I wrote many threads, but no-one was able to say
why.</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Anyway, hope it helps with your endeavors.</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">var layerTree = new Ext.tree.TreePanel({...etc</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"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><div>listeners: {</div><div> contextmenu: function (node, e) {</div><div> node.select();</div><div> var c = node.getOwnerTree().contextMenu;</div><div> c.contextNode = node;</div><div> c.showAt(e.getXY())</div><div> },</div><div> scope: this</div><div> },</div><div> contextMenu: new Ext.menu.Menu({</div><div> items:
[{</div><div> text: "Zoom to Layer Extent",</div><div> icon: '../images/arrow_out.png',</div><div> handler: function () {</div><div> var node = layerTree.getSelectionModel().getSelectedNode();</div><div> if (node && node.layer) {</div><div> this.map.zoomToExtent(node.layer.maxExtent)</div><div> }</div><div> },</div><div> scope: this</div><div>
},</div><div> {</div><div> text: "Metadata",</div><div> icon: '../images/grid.png',</div><div> handler: function () {</div><div> if (!winContext) {</div><div> var node = layerTree.getSelectionModel().getSelectedNode();</div><div> var layername = node.text;</div><div> var winContext = new Ext.Window({</div><div> title: '<span
style="color:#00; font-weight:bold;">Metadaten: </span>' + layername,</div><div> layout: 'fit',</div><div> text: layername,</div><div> width: 800,</div><div> height: 500,</div><div> closeAction: 'hide',</div><div> plain: true,</div><div> items: [tabsMetadata],</div><div>
buttons: [{</div><div> text: 'Schlie&szlig;en',</div><div> handler: function () {</div><div> winContext.hide()</div><div> }</div><div> }]</div><div> })</div><div>
}</div><div> winContext.show(this)</div><div> },</div><div> scope: this</div><div> },</div><div> removeLayerAction,</div><div> {</div><div> text: "Zusatzlayer hinzuf&uuml;gen",</div><div> icon: '../images/add.png',</div><div> handler: function () {</div><div> if (!capabiltieswin) {</div><div> capabiltieswin = new Ext.Window({</div><div>
title: "WMS Layer hinzuf&uuml;gen",</div><div> layout: 'fit',</div><div> width: '600',</div><div> height: 'auto',</div><div> border: false,</div><div> closable: true,</div><div> collapsible: true,</div><div>
x: 450,</div><div> y: 100,</div><div> resizable: true,</div><div> closeAction: 'hide',</div><div> plain: true,</div><div> tbar: [tabsMetadata]</div><div> })</div><div> }</div><div> capabiltieswin.show(this)</div><div>
}</div><div> }]</div><div> })</div><div> });</div></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"><br></font></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> Viola Anne <violaanne@gmail.com><br><b><span style="font-weight: bold;">An:</span></b> robertdbuckley@yahoo.com<br><b><span style="font-weight: bold;">Gesendet:</span></b> Dienstag, den 2. August 2011, 16:24:00 Uhr<br><b><span
style="font-weight: bold;">Betreff:</span></b> Context menu on right click -GEOEXT<br></font><br>Hi Robert,<div>Stumbled upon your question regarding context menu on right click, I have searched the mailing lists but with no success. You asked the exact qusetion am trying to solve today. <a rel="nofollow" target="_blank" href="http://www.mail-archive.com/users@geoext.org/msg01203.html">http://www.mail-archive.com/users@geoext.org/msg01203.html</a>:</div>
<div>I would like to achieve the same and am just wondering if you managed to get round this query. Any advice/help will be highly appreciated as I have been at it for some days now without any success.</div><div>I qoute your question on the mailing list.</div>
<div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; font-family: monospace; font-size: medium; ">
I would like to add a rightclick context menu to each layer in the layer tree which does the<br> following.<br>
1. Changes opacity of the layer<br>2. Offers metadata for that layer<br>3. Offers a download choice for that layer<br>4. Offers the ability to remove the layer</blockquote></div><div><br></div><div>Looking forward to your reply.<br clear="all">
<br>-- <br><div>Kind Regards,</div>
<div>Viola</div><br>
</div>
</div></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt; position: fixed; "></div>
</div></body></html>