OnClientItemBlur not firing

3 posts, 1 answers
  1. TriZetto
    TriZetto avatar
    17 posts
    Member since:
    Jul 2006

    Posted 20 Jul 2009 Link to this post

    I am using the Q2 2009 version of the controls and want to expand a default menu (Item A) when the mouse moves off of a different top level menu item (Item B). Item B does not have any subitems, so OnClientItemClosing and OnClientItemClosed are not available to me.

    I assigned a method to OnClientItemBlur, but this is never triggered. Do I need to do something else to enable this?

    I have also tried this:

    var menu = $find("<%=RadMenu.ClientID %>");
    menu.add_itemBlur(OnClientItemBlurHandler);

    but my handler is still not called.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Jul 2009 Link to this post

    Hello,

    Give a try with following approach in order to open a menu item on mouseout of another item.

    ASPX:
     
    <telerik:RadMenu ID="RadMenu1" runat="server" OnClientMouseOut="OnClientMouseOut"
        <Items> 
            <telerik:RadMenuItem runat="server" Text="ItemA"
                <Items> 
                 . . . 
                </Items> 
            </telerik:RadMenuItem> 
            <telerik:RadMenuItem runat="server" Text="ItemB"
            </telerik:RadMenuItem> 
        </Items> 
    </telerik:RadMenu> 

    JavaScript:
     
    <script type="text/javascript"
    function OnClientMouseOut(menu, args) 
        var ItemText = args.get_item().get_text(); 
        if(ItemText == 'ItemB'
        { 
            var item = menu.findItemByText('ItemA'); 
            item.open(); 
        } 
    </script> 

    -Shinu.
  3. TriZetto
    TriZetto avatar
    17 posts
    Member since:
    Jul 2006

    Posted 21 Jul 2009 Link to this post

    Thanks that works great.
Back to Top