Can't hide separator in client code when LightWeight

2 posts, 0 answers
  1. Andreas
    Andreas avatar
    137 posts
    Member since:
    May 2008

    Posted 27 Nov 2013 Link to this post

    Hi,

    When using LightWeight render mode, you get a javascript error when trying to hide a menu item from javascript code:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="menu.aspx.vb" Inherits="TestaTredjepartWeb.menu" %>
     
    <!DOCTYPE html>
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="s" runat="server">
            </asp:ScriptManager>
            <div>
                <table>
                    <tr>
                        <td>
                            <telerik:RadMenu ID="menu" runat="server" RenderMode="Lightweight">
                                <Items>
                                    <telerik:RadMenuItem Text="Test1" Value="item1"></telerik:RadMenuItem>
                                    <telerik:RadMenuItem IsSeparator="true" Value="separator"></telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="Test2" Value="item2"></telerik:RadMenuItem>
                                </Items>
                            </telerik:RadMenu>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="button" onclick="var menu = $find('menu'); menu.findItemByValue('item2').hide(); menu.findItemByValue('separator').hide();" value="Click to hide" />
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </body>
    </html>

    In the example above, the Test2-item gets hidden but a javascript error occurs when hiding the separator!
    Works fine when not using LightWeight...

    Regards
    Andreas
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 02 Dec 2013 Link to this post

    Hello Andreas,

    I would like to clarify that your observations are absolutely correct and this is a misbehavior with our RadMenu lightweight render mode. I have already logged it as a bug in our system for future fixing.

    Please excuse us for any inconveniences caused.


    Regards,
    Boyan Dimitrov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top