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

Ability to set permanent open state

1 Answer 108 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Marty
Top achievements
Rank 1
Marty asked on 25 Oct 2011, 11:21 AM
Some situations may require a particular menu branch to be open and stay open regardless of user interaction.  For example, the Amazon homepage where the menu is expanded and stays expanded no matter what you do.  Opening a Kendo menu is easily accomplished with the menu.open("#item") method.  However, there is no easy way (that I can think of) to keep the menu open if a user performs some actions. 

I would like to suggest an api method to keep a menu branch open regardless of user interaction.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 25 Oct 2011, 11:54 AM
Hi Marty,

I'm not sure what exactly do you have in mind, as in Amazon store, the menu on the left is a separate vertical menu on the first page and behaves as part of a normal drop down menu on the rest of the pages. You can use the same markup to initialize a vertical menu on the first page by passing the orientation option on creation:

$("#Menu").kendoMenu({ orientation: 'vertical' }).css({ width: '200px' });

and in internal pages you can render this markup as part of a bigger UL/LI structure and initialize it as usual.

If you still want to keep a drop down open - you can prevent the default action in an close handler:

function onClose(e) {
     if ($(e.item).index() == 0)
          e.preventDefault();
}
$("#Menu").kendoMenu({ close: onClose });


Though the menu will still close on document click.

All the best,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Menu
Asked by
Marty
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Share this question
or