Hi Geoffrey,
I followed the relevant links before creating the post. The TreePanel ColumnTree example at
https://examples1.ext.net/#/TreePane...ed/ColumnTree/ doesn't seem to have any mention of the ContextMenu, unless I'm missing something there.
The thread at
http://forums.ext.net/showthread.php...ay-contextmenu deals with pre-Ext.net development I believe and the code there is fragmented.
My problem here is rather trivial. I need to select a GridPanel row on the mouse right-click and present a Context menu. That's all. If you have a ready example at
https://examples1.ext.net, please refer me there kindly.
The code sample to start off is below, I need to select a grid row on right-click and make a call to a context menu similar to what I found in the old forum.
<Listeners>
<ContextMenu Handler="this.getSelectionModel().select(node);Coolite.AjaxMethods.FileView1.ShowMenu(node.id, e.getXY()[0], e.getXY()[1]);" />
</Listeners>
If the cursor is located outside the grid rows area, I need to recognize that fact by either not presenting a context menu or disabling it. Let me know if you need more info.
Thanks,
Vadym
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.DataBind();
}
}
private void DataBind()
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "id1", DateTime.Now.ToString() },
new object[] { "id2", DateTime.Now.ToString() },
new object[] { "id3", DateTime.Now.ToString() }
};
store.DataBind();
}
</script>
<!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 id="Head1" runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
<Store>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader IDProperty="ID">
<Fields>
<ext:RecordField Name="ID" />
<ext:RecordField Name="test" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column Header="ID" DataIndex="ID" />
<ext:Column Header="Test" DataIndex="test" Width="160" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" SingleSelect="true" runat="server" />
</SelectionModel>
</ext:GridPanel>
</form>
</body>
</html>