PDA

View Full Version : [CLOSED] ext:Image - How I can show a menu when click in ext:Image?



supera
May 10, 2012, 8:48 PM
Hi!

I wish show a menu when the user click in image on ext:Image...

How I do this? Not a context menu!

Daniil
May 10, 2012, 8:56 PM
Hi,

There is the Click event in Image. You can set up a listener.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:MenuItem runat="server" Text="Item" />
</Items>
</ext:Menu>

<ext:Image
runat="server"
Height="100"
Width="100"
ImageUrl="resources/images/test.png">
<Listeners>
<Click Handler="App.Menu1.showAt(e.getXY());" />
</Listeners>
</ext:Image>
</form>
</body>
</html>