This is a migrated thread and some comments may be shown as answers.

Rad menu using Mobile hamburger

3 Answers 186 Views
Menu
This is a migrated thread and some comments may be shown as answers.
James Shelton Agar
Top achievements
Rank 2
James Shelton Agar asked on 22 Jun 2015, 02:33 AM

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? 

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 22 Jun 2015, 11:33 AM
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
0
James Shelton Agar
Top achievements
Rank 2
answered on 23 Jun 2015, 05:45 AM
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
0
James Shelton Agar
Top achievements
Rank 2
answered on 23 Jun 2015, 05:57 AM
Sorry Dimitar ...please disregard my earlier response, the radmenu navigation/operation has this issue regardless if has sub menu item or not.
Tags
Menu
Asked by
James Shelton Agar
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
James Shelton Agar
Top achievements
Rank 2
Share this question
or