PDA

View Full Version : Help With Menu Panel Parameters



Groovepoets
Nov 03, 2009, 2:52 PM
I have a menu panel with multiple menu items. I can see js model for the menu panel and it's items during runtime, but am unable to figure out parameter names for the menu panel. What parameter to I need to send during MenuItemClick?

Also, the parameters have tripped me up more than once, so I'm wondering if there's a parameter reference for the controls, or if I've overlooked some other resource for the information?


Thanks,


Rick Spaulding
groovepoets@hotmail.com

jchau
Nov 04, 2009, 11:23 AM
Have you checked out the Toolbar pages in Example Explorer? What kind of parameters do you want to send? Here's a simple example of sending parameters to AjaxEvent. It can be applied to any AjaxEvents for any controls.



<script runat="server">


Public Sub MenuItemClick(ByVal sender As Object, ByVal e As AjaxEventArgs)
Dim param1 = e.ExtraParams("param1")
Dim param2 = e.ExtraParams("param2")

Ext.MessageBox.Alert("Test", String.Format("param1='{0}', param2='{1}'", param1, param2)).Show()
End Sub
</script>


<asp:Panel runat="server" ID="pnlTools" Height="50px">
<ext:Toolbar runat="server" ID="wsTools">
<Items>
<ext:Button runat="server" ID="btn" Text="Select">
<Menu>
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:MenuItem ID="MenuItem1" runat="server" Text="MenuItem1">
</ext:MenuItem>
<ext:MenuItem ID="MenuItem2" runat="server" Text="MenuItem2">
</ext:MenuItem>
</Items>
<AjaxEvents>
<ItemClick OnEvent="MenuItemClick">
<ExtraParams>
<ext:Parameter Name="param1" Value="param1" Mode="Value">
</ext:Parameter>
<ext:Parameter Name="param2" Value="menuItem.id" Mode="Raw">
</ext:Parameter>
</ExtraParams>
</ItemClick>
</AjaxEvents>
</ext:Menu>
</Menu>
</ext:Button>
</Items>
</ext:Toolbar>
</asp:Panel>