Welcome Guest Search | Active Topics | Sign In | Register

SlideMenu ItemClick Event for TopGroup Item with SubMenu Options
Tim
Posted: Monday, September 8, 2008 12:47:03 PM
Rank: Newbie
Groups: Member

Joined: 9/8/2008
Posts: 2
Is there a way to get the ItemClick event to fire for a TopGroup item when that item has submenu items?
eo_support
Posted: Monday, September 8, 2008 1:00:48 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,093
Hi,

I believe you can do that either by setting either the item or the menu's RaisesServerEvent to true.

Thanks
Tim
Posted: Monday, September 8, 2008 1:02:00 PM
Rank: Newbie
Groups: Member

Joined: 9/8/2008
Posts: 2
That does not seem to work.
eo_support
Posted: Monday, September 8, 2008 1:49:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,093
Hi,

Sorry that we did not realize that you were using SlideMenu, not Menu. Slide menu does not raises ItemClick event for top level items that have no sub items.

You can set the menu item's OnClickScript or handle the menu's ClientSideOnItemClick to call some JavaScript code and then trigger a post back in that JavaScript code. The following code would trigger ItemClick event for you:

Code: JavaScript
__doPostBack("SlideMenu1", "_i0");


The second parameter is the path of the item that you want to "click". By default, "_i0" stands for the first item, "_i1" is the second item, and so on. If you have set the item's ItemID property, then the path would be different. In that case you want to get the value of SlideMenu1.Items[x].Path (using the debugger, for example) first and then use that value.

Since the slide menu is not aware that ItemClick event is happening, you need to manually expand the "clicked" item on your server side code. It will be something like this:

Code: C#
private void SlideMenu1_ItemClick(
    object sender, EO.Web.NavigationItemEventArgs e)
{
    e.MenuItem.Expanded = true;
}


Hope this helps. Please let us know if you have any more questions.

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.