2 Replies Latest reply on Aug 21, 2012 6:41 AM by molzb

    Change the style of a single rich:menuItem

    molzb

      Hi!

       

      I would like to change the style of a single menu item.

      Let's say the menu item "Open" is black, "Delete" is red, "Close" is black.

       

      <rich:dropDownMenu mode="ajax">
        <rich:menuItem label="Open" action="..." icon="/open.png"/>
        <!-- The following menu item should be red, but is not -->
        <rich:menuItem label="Delete" action="..." icon="/del.png" styleClass="red"/>
        <rich:menuItem label="Close" action="..." icon="/close.png"/>
      </rich:dropDownMenu>
      

       

      How can I change the color of the menu item "Delete" to red

      (without using Javascript)?

       

      Well, in Javascript it would be something like

      jQuery('#frmMenu\\:itmEmergency span.rf-ddm-itm-lbl').css('color', 'red');

      but I guess, I can do it more elegantly.

       

      Thanks,

      Bernd