Radmenu in iFrame

2 posts, 0 answers
  1. David
    David avatar
    2 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2012 Link to this post

    Hi there

    I have an AJAX Q10 Radmenu that I have to run in an Iframe on an ASPX page.  I know this it totally not ideal, but to cut a long story short, this is the only way that we can integrate it into the code and we would really like to use the Radmenu in this scenario.

    I databind the Radmenu to the database with a lot of parent-child-child-child menus.  It runs perfectly in the Iframe, but sometimes, if you move the mouse fast over the iframe, the child will expand and not collapse after the mouse left the iframe.  So then you have an expanded radmenu sitting inside the iframe, and the only way to make it collapse, is to move the mouse over it again.

    I tried changing the expand delay to a higher value, or make it "click to open", but I still experience the behaviour where sometimes, it doesn't collapse due to the fact that it's running in the iframe and the mouse is no longer hovering over the iframe.  I get this behaviour in all browsers, IE 7, 8, 9, FF, Chrome, Safari.

    I hope this makes sense and I was hoping that there's a timeout script or something that I can place on the page with the radmenu running inside the iframe that will collapse all child menu's say after a second or two, if the mouse is no longer over it?

    Any advice would be appreciated!
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 27 Jun 2012 Link to this post

    Hello David,

    The setTimeout() function enables you close the RadMenu control depending on the time you specify in the function's argument. For instance with the below code the menu will close after 3 seconds:
    <script type="text/javascript">
           function OnClientItemOpened(sender, args) {
               setTimeout(" var menu = $find('menu1'); menu.close(true);", 3000);
           }
            </script>

    markup used:
    <telerik:RadMenu runat="server" ID="menu1" OnClientItemOpened="OnClientItemOpened">
               <Items>
                   <telerik:RadMenuItem Text="item1">
               ....
    </telerik:RadMenu>


    All the best,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top