|
Rank: Member Groups: Member
Joined: 9/14/2007 Posts: 12
|
hi, i try to change background color for selected item in side menu but it doesn’t effect. I put it on select style but it is not working. How can I force it to change the background color of selected menu item?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, There is a long answer for that: http://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fLookSkinAndTheme%2fLookSkinTheme.htmlHow TreeView applies style is much more complicated (and yet very powerful) than what may appear on the surface. You will also want to go over topics under "Style and Appearance". Once you read those you can try change various properties on the TreeView to see how they work. Thanks
|
|
Rank: Member Groups: Member
Joined: 9/14/2007 Posts: 12
|
actually i know how to change the Appearance of tree view by CSS and it works with tree view but i have the problem with side menu i can not do it on side menu and it is just with the selected item, the rest is working
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
All our navigation controls applies styles the same way. The only difference between slide menu and TreeView is, when a top level item is expanded, it automatically enters "selected" state. For this reason, slide menu almost always make use of _TopLevelItem. Still, even TreeView can make use of _TopLevelItem, it just doesn't use it often.
Thanks
|
|
Rank: Member Groups: Member
Joined: 9/14/2007 Posts: 12
|
the _TopLevelItem selected style only effect the top menu item but i need to change back ground for sub menu item
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Then most likely you didn't even select the item at all. While the TreeView automatically select a node when the node is clicked, a SlideMenu is purely used for navigation purpose and it does not automatically select on click by default. When you click a slide menu item, it navigates you to NavigateUrl or raises a server event and that would be the end of it. If you use NavigateUrl, you can make AutoSelectSource to automatically select the item for you. Otherwise you will need to select the item by yourself, either on the server side or on the client side. On the server side is easy, on the client side you can handle ClientSideOnItemClick:
Code: JavaScript
var g_lastSelectedItem = null;
function on_slide_menu_click(e, info)
{
if (g_lastSelectedItem)
g_lastSelectedItem.setSelected(false);
var item = info.getItem();
if (item.getLevel() == 0)
return;
g_lastSelectedItem = item;
g_lastSelectedItem.setSelected(true);
}
|
|