PDA

View Full Version : Pop-up a menu on clicking a link



Qoca
13 Jan 2010, 6:23 PM
Hi, this should be a simple question. However, I could not find a relevant answer for it. Please help:

I would like to pop-up a menu on clicking a link.

E.g.


<a href="javascript:popup()">link</a>

<script type="text/javascript">
function popup() {
MyMenu = new Ext.menu.Menu();
MyMenu.addItem(Ext.menu.TextItem("Choice1"));
MyMenu.addItem(Ext.menu.TextItem("Choice2"));
// How to show MyMenu at click location, e.g. MyMenu.showAt(clickLocation)?
}
</script>


I found solutions for popping up a menu upon right-click ("RowContextMenu"), but they ofcourse don't work in this case. Please help.

Thanks!

Animal
13 Jan 2010, 10:17 PM
href = javascript:....?

No.

Add a listener.

In which case, does it need to be a link?

You want to create a new Menu on every click??????????????????