Rad menu using Mobile hamburger

4 posts, 1 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 21 Jun 2015 Link to this post

    The open sub menu function only works when the >
    image is selected, not anywhere in the item (as would be expected)

    But when going back the user can select any area in
    the menu item and it will go back correctly (as you would expected)

     

    It has been like this for some years or am I doing something wrong? 

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    281 posts

    Posted 22 Jun 2015 Link to this post

    Hello,

    The Mobile RadMenu behavior described is expected. Clicking on a not expanded item itself would trigger navigation if the NavigateUrl property is set for that item. For expanding child items, you should click/tap on the expand arrow. This two elements separate the item and allow both functionalities to exist and work without conflicting one another. And when you want to collapse an item, the NavigateUrl is not attached to the parent in this case and you can tap anywhere on the item.

    If child items were to be expanded on clicking the parent item itself, we would have to either have no NavigateUrl feature implemented or would have a bug where both navigation and expanding child items would happen.


    If you would like, you can achieve expanding sub-items when tapping anywhere by handling the RadMenu OnClientItemClicking event with JavaScript as shown in the following snippet:

    <telerik:RadMenu ID="RadMenu1" runat="server" RenderMode="Mobile" OnClientItemClicking="OnClientItemClicking">
       
    <script type="text/javascript">
        function OnClientItemClicking(sender, args) {
            if (args.get_item().get_navigateUrl() == null) {
                args.get_item().open();
                args.set_cancel(true);
            }
        }
    </script>

    In this case, there is a check if the parent item has a navigateUrl set and the sub-items will be expanded only, if there is not Url set. You may further customize this code to fit your case.

    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 23 Jun 2015 Link to this post

    Thks for the quick response Mark/Dimitar...this
    is a complex issue especially when the page is viewed in landscape on a mobile
    device, (users will nearly always be required to scroll the menu) and perhaps explains why so many
    websites now have ‘flat’ menu structures.

    Our solution will be to leave the radMenu with the default expected behavior and remove the sub menus.

    Again thanks for your prompt reply
  5. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 23 Jun 2015 Link to this post

    Sorry Dimitar ...please disregard my earlier response, the radmenu navigation/operation has this issue regardless if has sub menu item or not.
Back to Top