|
Rank: Member Groups: Member
Joined: 5/27/2010 Posts: 22
|
Hi,
I'm trying to change the color of a MenuItem when Clicked, and alternate the color change when a different item is clicked for that Submenu group , and I haven't been able to find the property for it.
Is there one, or do I need to use code behind?
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You will need to edit the menu item's Selected state to have a different background color, then use JavaScript code to switch the menu item to Selected state when clicked. You can find more information about menu item state here: http://doc.essentialobjects.com/library/1/menucommon/styleandappearance/item_state.aspxAbout how to handle menu item click event with JavaScript: http://doc.essentialobjects.com/library/1/menucommon/handlingevent/client_event.aspxAnd all the available client side objects/methods: http://doc.essentialobjects.com/library/1/clientapi_howto.aspxYou can also do it through code behind but because it requires a post back, the user experience won't be as good as doing it on client side. Hope those helps. Thanks!
|
|
Rank: Member Groups: Member
Joined: 5/27/2010 Posts: 22
|
Hi,
I was not able to get the JavaScript to work with the Slidemenu, The examples work with a regular Menu. Maybe you can send an example please.
However , I was able to do it from code behind, and being that I am using a callback panel , I simply included the slidemenu in the group for the callback, and it works fine without another callback.
Thank you for your advice!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The code for slide menu should be the same except for that Menu and SlideMenu interprets the "Selected" state slightly differently. Menu will never automatically switch an item to Selected state. However for Slide Menu, the top level item automatically enters Selected state when it is expanded. This also means if you wish to "Select" top level slide menu items, you must call expandSubMenu to expand it. If you continue to have problem, please create a test page with your code and we will be happy to take a look.
Doing it inside a CallbackPanel is a good alternative though.
Thanks!
|
|