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

I want the submenu to open on click.

5 Answers 557 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Iron
Vincent asked on 23 May 2018, 03:42 PM
I want the submenu to open on click. How can I get it?

5 Answers, 1 is accepted

Sort by
0
Ivan Zhekov
Telerik team
answered on 24 May 2018, 12:44 PM
Hi, Vincent.

To open menu on click, just set openOnClick.rootMenuItems to true and openOnClick.subMenuItems to true. Here is an example -- https://dojo.telerik.com/@joneff/onopiVAP.



Regards,
Ivan Zhekov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vincent
Top achievements
Rank 1
Iron
answered on 25 May 2018, 02:13 AM

Thank you for you reply, It is work as follow,

 @(Html.Kendo().Menu().OpenOnClick(true)

but how can I use in taghelper.

 <kendo-menu name="MainMenu" openOnClick="true">  It doesn't work ...

0
Vincent
Top achievements
Rank 1
Iron
answered on 26 May 2018, 04:12 AM
Thank you for you reply, It is work as follow,
 @(Html.Kendo().Menu().OpenOnClick(true)
but how can I use in taghelper.
 <kendo-menu name="MainMenu" openOnClick="true">  It doesn't work ...
0
Dimitar
Telerik team
answered on 29 May 2018, 12:37 PM
Hello Vincent,

You could set the openOnClick option with the Menu TagHelper as follows:
 <kendo-menu name="menu">
    <items>
        <menu-item text="Home"></menu-item>
        <menu-item text="Products">
            <sub-items>
                <menu-item text="Furniture">
                    <sub-items>
                        <menu-item text="Tables & Chairs"></menu-item>
                        <menu-item text="Sofas"></menu-item>                      
                    </sub-items>
                </menu-item>
                <menu-item text="Decor">
                    <sub-items>
                        <menu-item text="Bed Linen"></menu-item>
                        <menu-item text="Throws"></menu-item>                      
                    </sub-items>
                </menu-item>
            </sub-items>
        </menu-item>               
    </items>
    <open-on-click enabled="true" root-menu-items="true" sub-menu-items="true" />   
 </kendo-menu>

The above is also demonstrated on the following Menu Demo for ASP.NET Core.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vincent
Top achievements
Rank 1
Iron
answered on 02 Jun 2018, 03:41 AM
thanks. It worked.
Tags
Menu
Asked by
Vincent
Top achievements
Rank 1
Iron
Answers by
Ivan Zhekov
Telerik team
Vincent
Top achievements
Rank 1
Iron
Dimitar
Telerik team
Share this question
or