Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
How to clear a seperator in client-side script for UltraWebMenu
posted

I am currently using the client-side script workaround for hiding a menu item by setting the text to an empty string and setting the enabled property to false.

childMenuItem.setText('');
childMenuItem.setEnabled(false);

This doesn't work for hiding a separator, since it has no text and is disabled by default.

The CSOM for a menu item does not have a setSeparator() or setSeparatorImage() method.

Question: Is there a way to make the separator not appear in client side script?

 

  • 28464
    posted

    The client-side Item object provides a property called Element, leading to the Html Element of the item. This is typically a table element. For separators, a typical rendering is the following:

    <table width='100%' igSep='1' id='UltraWebMenu1_1_2'>
        <tr>
            <td class='ig_7af86498_r8 SeparatorClass'></td>
        </tr>
    </table>

    So I gess starting from childMenuItem.Element you can go to the inner TD element and clear the class attribute.

    Hope this helps,