Can't hide separator in client code when LightWeight

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

    Posted 27 Nov 2013 Link to this post


    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="" %>
    <!DOCTYPE html>
    <head runat="server">
        <form id="form1" runat="server">
            <asp:ScriptManager ID="s" runat="server">
                            <telerik:RadMenu ID="menu" runat="server" RenderMode="Lightweight">
                                    <telerik:RadMenuItem Text="Test1" Value="item1"></telerik:RadMenuItem>
                                    <telerik:RadMenuItem IsSeparator="true" Value="separator"></telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="Test2" Value="item2"></telerik:RadMenuItem>
                            <input type="button" onclick="var menu = $find('menu'); menu.findItemByValue('item2').hide(); menu.findItemByValue('separator').hide();" value="Click to hide" />

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

  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    1968 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.

    Boyan Dimitrov
    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.
Back to Top