Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
535
How to detect which -sub -sub menu item was selected (UltraWebMenu).
posted
 using UltraWebMenu . . . . I can set a break point in

UltraWebMenu_MenuItemClicked and know what was clicked . . . . but only for
top level and 1 level down menus . . .

why doesn't UltraWebMenu_MenuItemClicked fire for

-sub -sub (flyout) menu selections ???? 

Thx,

XPXJ

Infragistics35.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009

Parents
No Data
Reply
  • 28407
    posted

    HI ,

     My Client-Size Item_click event fires for all levels. The ItemId of the ItemClick event has the full path of the menu index appended to it.

     You can also get the level number by using the MenuItems getLevel method. You can also use the getText method to get the menu text.

    Here is the code to my aspx page: (I tested clr 3.5 as well)

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <%@ Register Assembly="Infragistics2.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.WebUI.UltraWebNavigator" TagPrefix="ignav" %>

    <!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>Untitled Page</title>

        <script type="text/javascript" id="igClientScript">
    <!--

    function UltraWebMenu1_ItemClick(menuId, itemId){
     //Add code to handle your event here.
     debugger;
     alert(itemId);
     var item =  igmenu_getItemById(itemId);
     alert(item.getLevel());


    }
    // -->
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ignav:UltraWebMenu ID="UltraWebMenu1" runat="server" JavaScriptFilename=""
                JavaScriptFileNameCommon="" WebMenuTarget="VerticalMenu">
                <IslandStyle BackColor="LightGray" BorderStyle="Outset" BorderWidth="1px"
                    Cursor="Default">
                </IslandStyle>
                <HoverItemStyle BackColor="DarkBlue" Cursor="Default" ForeColor="White">
                </HoverItemStyle>
                <Images>
                    <SubMenuImage Url="ig_menuTri.gif" />
                </Images>
                <ItemStyle Cursor="Default">
                <Padding Left="0px" />
                </ItemStyle>
                <Items>
                    <ignav:Item Text="Top Item">
                        <Items>
                            <ignav:Item Text="Sub Menu Item">
                            </ignav:Item>
                            <ignav:Item Text="Sub Menu Item">
                                <Items>
                                    <ignav:Item Text="policy">
                                    </ignav:Item>
                                    <ignav:Item Text="Sub Menu Item">
                                    </ignav:Item>
                                    <ignav:Item Text="Sub Menu Item">
                                    </ignav:Item>
                                    <ignav:Item Text="Sub Menu Item">
                                    </ignav:Item>
                                </Items>
                            </ignav:Item>
                            <ignav:Item Text="Sub Menu Item">
                            </ignav:Item>
                        </Items>
                    </ignav:Item>
                    <ignav:Item Text="Top Item">
                        <Items>
                            <ignav:Item Text="Sub Menu Item">
                            </ignav:Item>
                            <ignav:Item Text="Sub Menu Item">
                            </ignav:Item>
                        </Items>
                    </ignav:Item>
                    <ignav:Item Text="Top Item">
                        <Items>
                            <ignav:Item Text="Sub Menu Item">
                            </ignav:Item>
                            <ignav:Item Text="Sub Menu Item">
                            </ignav:Item>
                        </Items>
                    </ignav:Item>
                </Items>
                <DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray">
                </DisabledStyle>
                <Levels>
                    <ignav:Level Index="0" />
                    <ignav:Level Index="1" />
                    <ignav:Level Index="2" />
                </Levels>
                <SeparatorStyle BackgroundImage="ig_menuSep.gif" CssClass="SeparatorClass"
                    CustomRules="background-repeat:repeat-x; " />
    <ExpandEffects ShadowColor="LightGray"></ExpandEffects>

    <MenuClientSideEvents ItemClick="UltraWebMenu1_ItemClick"></MenuClientSideEvents>
                <ParentItemStyle>
                    <Padding Left="0px" Right="10px" />
                </ParentItemStyle>
            </ignav:UltraWebMenu>
        </div>
        </form>
    </body>
    </html>

Children