Hello,
I have a button OnclientClick function.
<asp:Button ID="Button1" runat="server" OnClientClick="Node_Click();" />
My javascript function is
function Node_Click(tree, eventArgs) { lastNode = eventArgs.getNode(); var menu = $find("<%= ContextMenu.ClientID %>"); if (menu != null && eventArgs.get_browserEvent() != null && eventArgs.get_browserEvent().button == 2) { menu.showAt(null, null, eventArgs.get_browserEvent()); } My question is How can I pass the value EventArgs from my Onclientclick function.
Right now it is returning null.
HI Sanjay,
Per our chat conversation, I will be looking into these questions:
1.) Given that you have a button in an asp:GridView, you want to show the WebDataMenu on a right-click of the button, but you are unable to do so, as the eventArgs passed to the Node_Click() event is null.
aspx code:
Button in the gridview: <asp:Button ID="Button1" runat="server" OnClientClick="Node_Click();" />
WebDataMenu: <ig:WebDataMenu runat="server" ID="ContextMenu" IsContextMenu="true" BorderWidth="1" BorderColor="#CCCCCC" > <ClientEvents ItemClick="MenuItem_Click" /> <Items> <ig:DataMenuItem Text="CaseSummary" Key="edit" /> <ig:DataMenuItem Text="Plaintiff" Key="expand" /> <ig:DataMenuItem Text="Defendant" Key="Explore" /> <ig:DataMenuItem Text="Notes" Key="New" /> <ig:DataMenuItem Text="Incident" Key="Delete" /> <ig:DataMenuItem Text="Negotiation" Key="Sento" /> </Items> </ig:WebDataMenu><asp:Button ID="Button1" runat="server" OnClientClick="Node_Click();" />
BLOCKED SCRIPT
function Node_Click(tree, eventArgs) { lastNode = eventArgs.getNode(); var menu = $find("<%= ContextMenu.ClientID %>");
if (menu != null && eventArgs.get_browserEvent() != null && eventArgs.get_browserEvent().button == 2) { menu.showAt(null, null, eventArgs.get_browserEvent()); }
2.) How can the WebDataMenu be implemented inside the gridview?
Thanks,
Francis
Hello Francis,
DId you find a solution to this problem?
Thanks
Hello Sanjay,
I am unsure what you are trying to accomplish since the eventargs parameter from an asp:Buttondoesn't have a function eventArgs.getNode(). Please clartify what you are hoping to accomplish so that I can be of more assistance.
Sincerely,
Valerie
Have you been able to resolve your issue?
Please provide me with more details about what you are trying to do and I can provide you with additional assistance.
Thanks,Valerie