Hi there, I'm having a small issue with a custom context menu on a grid. Try as I might, I cannot seem to get the click event to fire. Eventually, I'm going to want it to do a postback to server-side, but at the moment I can't seem to get the event to fire at all. Any help would be much appreciated. Code is below. I realise that Delete item is a default menu item, but I'm using MySQL databases rather than SQL and can't seem to find any documentation on how to connect grid to MySQL, so I'm doing it server-side.
<ej:Grid ID="gridBookStock" runat='server' OnServerEditRow="gridBookStock_ServerEditRow" Locale="en-GB">
<EditSettings AllowEditing="True" AllowAdding="false" AllowDeleting="True" EditMode="Normal"></EditSettings>
<ClientSideEvents ContextClick="contextClick" />
<ContextMenuSettings EnableContextMenu="true" DisableDefaultItems="true">
<CustomContextMenuItem>
<ej:CustomContexMenuItems Id="delete" Text="Delete Item" />
</CustomContextMenuItem>
</ContextMenuSettings>
<ClientSideEvents RowDataBound="rowDataBound" />
<Columns>
<ej:Column Field="ID" IsPrimaryKey="true" HeaderText="ID" TextAlign="Right" Width="100" Visible="false" />
<ej:Column Field="partsid" HeaderText="ID" Width="100" Visible="false" />
<ej:Column Field="partname" HeaderText="Description" Width="100" />
<ej:Column Field="amount" HeaderText="Quantity" Width="100" EditType="Numeric" />
<ej:Column Field="instock" HeaderText="In Stock" Width="100" />
<ej:Column Field="availablestock" HeaderText="Available" Width="100" />
</Columns>
</ej:Grid>
<script type="text/javascript">
function rowDataBound(args) {
if (args.data.availablestock < args.data.amount)
args.row.css("backgroundColor", "#F3C3C3").css("color", "black");/*custom css applied to the row */
}
</script>
<script>
function contextClick(args) {
alert("hi");
}
</script>
Thanks all...