Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Menu: how to specify help text in HTML code

Expand Messages
  • Todd Kloots
    Venkat - Yes, it is possible to add items through JavaScript. The Menu landing page (http://developer.yahoo.com/yui/menu) explains how and there are many
    Message 1 of 4 , Oct 4, 2008
    • 0 Attachment
      Venkat -

      Yes, it is possible to add items through JavaScript. The Menu landing
      page (http://developer.yahoo.com/yui/menu) explains how and there are
      many examples of adding MenuItems via JavaScript in the Menu examples
      gallery (http://developer.yahoo.com/yui/examples/menu).

      - Todd

      Venkat Sadasivam wrote:
      > Todd,
      >
      > I created a menubar through markup. Is possible for me to add menu
      > items through JavaScript?
      >
      > I tried the following code, it doesn't work:
      > // since the MenuManager is singleton, I tried accessing the function
      > directly.
      > var actionMenusObj = YAHOO.widget.MenuManager.getMenu('actionMenus');
      > var menuItems = [{ text: "Print", helptext: "Ctrl + P" } ];
      > actionMenusObj.addItems(menuItems);
      >
      > Regards,
      > Venkat
      >
      > ----- Original Message ----
      > From: Todd Kloots <kloots@...>
      > To: ydn-javascript@yahoogroups.com; venkatsalem@...
      > Sent: Friday, 3 October, 2008 2:04:02 PM
      > Subject: Re: [ydn-javascript] Menu: how to specify help text in HTML code
      >
      > Venkat -
      >
      > YUI Menu doesn't support setting the "helptext" configuration property
      > from existing markup. YUI Menu is designed around the principles of
      > Progressive Enhancement
      > (http://en.wikipedia .org/wiki/ Progressive_ Enhancement
      > <http://en.wikipedia.org/wiki/Progressive_Enhancement>) and Unobtrusive
      > JavaScript (http://en.wikipedia .org/wiki/ Unobtrusive_ JavaScript
      > <http://en.wikipedia.org/wiki/Unobtrusive_JavaScript>), and
      > help text represents a keyboard shortcut, and keyboard shortcuts require
      > JavaScript be enabled, it only makes sense to set that helptext via
      > JavaScript.
      >
      > - Todd
      >
      > Venkat Sadasivam wrote:
      > > Hi,
      > >
      > > I am creating menu from HTML code. How do I specify the help text in
      > > the HTML code?
      > >
      > > My Code:
      > > <ul class="first- of-type">
      > > <li class="yuimenubarit em first-of-type" ><a
      > > class="yuimenubarit emlabel" href="#">File< /a>
      > > <div id="communication" class="yuimenu" >
      > > <div class="bd">
      > > <ul>
      > > <li class="yuimenuitem" ><a class="yuimenuiteml abel"
      > > href="javascript: f_addTab( 'Import', '/admin/Import. jsp')">Import<
      > /a></li>
      > > <li class="yuimenuitem" ><a class="yuimenuiteml abel"
      > > href="javascript: f_addTab( 'Export',
      > > '/admin/Export_ all.jsp') ">Export< /a></li>
      > > <li class="yuimenuitem" ><a class="yuimenuiteml abel"
      > > href="javascript: f_addTab( 'Clear Cache',
      > > '/admin/CacheClear. jsp')">Clear Cache</a></li>
      > > <li class="yuimenuitem" ><a class="yuimenuiteml abel"
      > > href="../logoff. jsp?lid=< %=__JspAide. lid%>">Exit< /a></li>
      > > </ul>
      > > </div>
      > > </div>
      > > </li>
      > > </ul>
      > >
      > > Regards,
      > > Venkat
      > >
      > > ------------ --------- --------- --------- --------- --------- -
      > > Add more friends to your messenger and enjoy! Invite them now.
      > > <http://in.rd yahoo.com/ tagline_messenge r_6/*http: //messenger.
      > yahoo.com/ invite/
      > <http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/>>
      >
      > >
      > >
      >
      >
      > ------------------------------------------------------------------------
      > Add more friends to your messenger and enjoy! Invite them now.
      > <http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/>
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.