| Page 1 of 1 | [ 2 posts ] |
|
Hi, how can set a menubar item to 'disabled' after it has been rendered?
myitem is .... <li class="yuimenuitem"><a class="yuimenuitemlabel" onclick="" id="myitem">MYTEXT</a></li> I tried: 1) mymenubar.getMenuItem('myitem').cfg.setProperty("disabled", true); 2) YAHOO.widget.MenuManager.getMenu('myMenubar').getMenuItem('myitem').cfg.setProperty("disabled", true); but nothing works thankyou in advance for any answer Rudy |
|
I'll answer by myself, maybe useful to someone
I have 4 different menu instance in my page whose items come from database. I don't know at what index a specific menuItem will be, but I need to enable/disable some of them. so first of all add a global var for then menu Manger Code: var menuM=YAHOO.widget.MenuManager; in the function that create and render the/each menu like Code: xMenu = new YAHOO.widget.MenuBar("mainmenu",........ ... xMenu.render(); add the menu to the ManuMenager Code: menuM.addMenu('mainmenu'); ... menuM.addMenu('menuazioni'); from now you can access each menuitem in any menu using its Id. For instance, to disable the menuitem "eseguito" in a menu like that Code: <div id="menuazioni" class="yuimenu"> <div class="bd"> <ul class="first-of-type"> <li class="yuimenuitem" id="eseguito"><a class="yuimenuitemlabel" href="javascript:azione='3';esegui();" >ESEGUITO</a></li>...... simply use Code: Event.onContentReady("eseguito", function(){ menuM.getMenuItem('eseguito').cfg.setProperty("disabled", true); }); |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group