Welcome Guest Search | Active Topics | Sign In | Register

How to keep the menu clicked in a depressed state Options
Gordsh
Posted: Tuesday, November 3, 2009 3:51:22 PM
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
eo_support
Posted: Tuesday, November 3, 2009 4:00:35 PM
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!
Gordsh
Posted: Tuesday, November 3, 2009 7:58:21 PM
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
eo_support
Posted: Tuesday, November 3, 2009 8:35:07 PM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.