Rank: Advanced Member Groups: Member
Joined: 7/3/2009 Posts: 37
|
Is it possible to collapse a slidemenu menuitem in javascript? I know how to do this on the serverside but what about on the clientside. Do you have any examples.
Server Side Example:
if (e.MenuItem.Expanded== true) { e.MenuItem.Expanded= false;} else {e.MenuItem.Expanded= true;}
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, I believe it is available through our client side API: http://doc.essentialobjects.com/library/1/clientapi_howto.aspxThanks!
|
Rank: Advanced Member Groups: Member
Joined: 7/3/2009 Posts: 37
|
Thanks for pointing me in the right direction I almost got it going but I can't mimic the server code on the client side. There isn't a expanded method on the clientside. With the jscript code (see below) I try to toggle open/close on the menuitem but it won't work right. It opens and closes but not on th third click on the menuitem. Basically I want it to toggle open and close everytime I select the menuitem. On the serverside it's straight forward see below. Is there a jscript method I can use that works like the expanded method on the server side? Your help will be appreciated very much, thanks.
Server Side Example:
if (e.MenuItem.Expanded== true) { e.MenuItem.Expanded= false;} else {e.MenuItem.Expanded= true;}
function on_item_click(e, info) { //This function allows the slidemenu to close/collapse when the icon or text is selected.
//info is the NavigatorEventInfo var group= info.getItemGroup(); //Get the ItemGroup //Get the index location of the selected menu Item. var iIndexLocation= info.getItem().getIndex(); //collapses the sub menu if it is currently expanded, otherwise it does nothing. group.getItemByIndex(iIndexLocation).collapseSubMenu(); }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Please check whether you have the latest version. It has expandSubMenu method: http://doc.essentialobjects.com/library/1/jsdoc.public.menuitem.expandsubmenu.aspxThanks
|