This is a migrated thread and some comments may be shown as answers.

Can't hide separator in client code when LightWeight

1 Answer 22 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 27 Nov 2013, 10:37 AM
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

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 02 Dec 2013, 12:16 PM
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.
Tags
Menu
Asked by
Andreas
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or