If my WebDataMenu has a submenus, they do not pop open when I browse over them. Instead, I must click on submenus to make them open. This is not like Windows, where all cascading menus automatically open when you glide your mouse over them. (see image for an example)
Is there a setting to fix this?
Hi raywhite,
The default behavior of WebDataMenu is to expand sub-menus when hover on item. Try the simplest example:
The problem is EnableExpandOnClick="True".
When you set this property, the submenus don't open automatically. But you need this to make the menu act like normal Windows menus that only open when you click them. After clicking them, the submenus should open automatically.
I just want the menus to act like normal Windows menus.
How can I do that?
I think I got your point. You have menu with sub-menus and you want to expand the first level of the menu with click and all other levels below with hover. If this is your scenario, please, set EnableExpandOnClick="True" and then handle <ClientEvents ItemHovered="hovered" /> in the following way:
function hovered(sender, args) { var item = args.getItem(); if (item.get_level() > 0) { item.open(); } }
I'm sending you a sample, where you can observe the desired behavior.
Perfect!
It would be nice for all the top-level menus to pop open when hovered, once the first one was clicked, but I won't get greedy. This is good enough.
No need to respond. Your fix above works for now. Thanks!
I'm glad I could help!
About your last request, it has easy implementation - add global array that will keep keys of all items from level 0 which are expanded with click at first time. This can be handled on ItemClick event. And just include them on the ItemHover event, in the check that determines which item should be expand on hover.
A sample is attached for better understanding!