|
Rank: Member Groups: Member
Joined: 8/16/2009 Posts: 13
|
Hello,
I am using the Menu control and would like to know how to keep the menu in its clicked state after the user has clicked a menu item. This way you can look at the menu and see which menu item was clicked?
Currently the menu simply returns to it normal state after the each menu item has been clicked and you cant realy tell which item was clicked.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi,
You can use "Selected State" for this purpose. You would need to:
1. Handle the menu's client side click event (either on menu or on menu item) to set the clicked item to "Selected state"; 2. Specify "SelectedStyle" to include CSS properties that creates a depressed look (A different border, background color, or padding, etc);
Please let us know if this makes sense to you.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/16/2009 Posts: 13
|
Would you be able to give me some Java Script code as an examle on how to do this please? I am comfortable doing things on the server side (ASP.net) but not so much on the client side.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi, You would do something like this:
Code: JavaScript
function on_item_click(e, info)
{
//Get the menu item that was clicked
var item = info.getItem();
//Put the item into selected state
item.setSelected(true);
}
Code: HTML/ASPX
<eo:Menu ClientSideOnItemClick="on_item_click" ....>
....
</eo:Menu>
The above menu is set to call JavaScript function "on_item_click" when an item is clicked. The code then set the clicked item to selected state. Note setting an item to selected state does not automatically clears any other item's "selected" state. Hope this helps. Please feel free to let us know if you have any more question. Thanks
|
|