1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Expanded sub menu with RadMenu

Expanded sub menu with RadMenu

10 posts, 0 answered
  1. Grant
    Grant avatar
    13 posts
    Registered:
    24 Jan 2008
    16 Dec 2008
    Link to this post
    Using the radMenu, where is the setting to have the secondary navigation remain expanded when you are on a subpage?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Dec 2008
    Link to this post
    Hi Grant,

    Thank you for using our services.

    Could you explain some more about your approach and give us an example? You may find the following KB useful Expand menu when the user clicks a menu item

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Grant
    Grant avatar
    13 posts
    Registered:
    24 Jan 2008
    17 Dec 2008
    Link to this post
    Hi,

    This is not an onclick issue. The sub menu needs to be expanded on the subpage when it loads. Is there a setting for this?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Dec 2008
    Link to this post
    Hi Grant,

    There is not setting for the required functionality. But you could implement it by yourself. I would suggest you test the example provided in the KB I have sent you in the previous post. Actually, the menu expands on page load depending on the current URL. This means that if you type "http://localhost/SitefinityProject/Home/Company.aspx" in the browser address bar, Company menu item will be expanded.

    Please, describe in details if you need any different functionality.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Drew
    Drew avatar
    16 posts
    Registered:
    19 Sep 2008
    18 Dec 2008
    Link to this post
    Hello,

    The above solution is almost exactly what we needed.  We need to expand on the functionality though.  When the page loads, the sub menu for the current parent node displays perfectly.  However,  if we hover over the sub menu without clicking any items and then mouse off the sub menu it disappears.  Using the onClientMouseOver and onClientMouseOff events, how can we persist the sub menu after we the user rolls over and off the sub menu without clicking any nodes?  Any info is greatly appreciated.

    Thanks.
    -Drew

  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Dec 2008
    Link to this post
    Hi Drew,

    Try adding the following code to the OnClientItemOpened="itemOpened" and OnClientItemClosing="testFunc" events.


    var openedItemVal = ""
    var shouldClose = false
     
    function itemOpened(sender, args) { 
        var item = args.get_item(); 
        if (openedItemVal != "") { 
            var openedItem = sender.findItemByValue(openedItemVal); 
            if (openedItem != item) { 
                shouldClose = true
                openedItem.close(); 
                openedItemVal = item.get_value(); 
            } 
        } 
        else { 
            openedItemVal = item.get_value(); 
        } 
     
    function testFunc(sender, args) { 
        if (shouldClose == false) { 
            args.set_cancel(true); 
        } 
        else { 
            shouldClose = false
        } 

    The code will prevent items from collapsing till the other menu item is hovered.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Drew
    Drew avatar
    16 posts
    Registered:
    19 Sep 2008
    29 Dec 2008
    Link to this post
    Hi,

    Using the javascript that was linked to in the knowledge base we are getting a javascript error at parent.open().

    Could you explain what the open() function is supposed to be doing and how to resolve this?
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Dec 2008
    Link to this post
    Hi Drew,

    The KB article has been fixed a week ago. There was a problem with one of the supported method of the parameter related to parent.open();

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Drew
    Drew avatar
    16 posts
    Registered:
    19 Sep 2008
    31 Dec 2008
    Link to this post
    Hi,

    Thanks. The updated KB article fixed the javascript error.

    There are a couple of issues still with the menu. The submenu needs to expand on root level pages that have subpages which it currently does not. It only now expands on the subpages themselves.

    Also when you mouse off the navigation it needs to show the submenu of the page you are on and not leave open the submenu of the last element you hovered over.

    How can we resolve these issues?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Jan 2009
    Link to this post
    Hi Drew,

    Take a look at RadMenu developer manual - Client-Side events. You should create an instance of the menu firing the OnClientMouseOver client-side event.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
10 posts, 0 answered