set_visibleStatusbar doesn't work if RenderMode is lightweight

4 posts, 1 answers
  1. Rob
    Rob avatar
    43 posts
    Member since:
    Aug 2010

    Posted 04 Nov 2013 Link to this post

    I have recently upgraded a project to Telerik.Web.UI.dll 2013.3.1015.40.  Our RadWindows are opened through a common handler function which calls set_visibleStatusbar(false), this no longer works if I set RenderMode to auto in web.config and view in a modern browser.  I have verified by manually getting a reference to the window in the browser console and calling the method directly, the status bar does not disappear.

    The status bar does disappear if I set the RenderMode to classic in web.config or set VisibleStatusbar="false" in the aspx.

    This seems like a bug to me, anything I might have overlooked?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Nov 2013 Link to this post

    Hi Rob,

    Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample code I tried which works fine at my end.

    ASPX:
    <telerik:RadWindow ID="RadWindow1" runat="server" Title="Details">
    </telerik:RadWindow>
    <telerik:RadButton ID="RadButton1" runat="server" Text="ShowWindow" OnClientClicked="OnClientClicked1"
        AutoPostBack="false">
    </telerik:RadButton>

    web.config:
    <appSettings>
      <add key="Telerik.Web.UI.Window.RenderMode" value="lightweight" />
    </appSettings>

    JavaScript:
    <script type="text/javascript">
        function OnClientClicked1(sender, args) {
            var win = $find("<%=RadWindow1.ClientID %>");
            win.set_visibleStatusbar(false);
            win.Show();
        }
    </script>

    Thanks,
    Shinu
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rob
    Rob avatar
    43 posts
    Member since:
    Aug 2010

    Posted 05 Nov 2013 Link to this post

    Here is a screenshot of it not working.  I'll open a support ticket so I can upload the code.
  5. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 06 Nov 2013 Link to this post

    Hi guys,

    I can confirm this is a bug with the lightweight render mode and I have logged it for fixing.

    In the meantime I can offer two workarounds:
    - set the VIsibleStatusbar property of the RadWIndowManager to false, if all your RadWindows need no statusbar

    OR


    - use the following script if some do and you need to hide it for the rest:
    oWnd = window.radopen(pageURL, winName);
    //will work for classic rendermode
    oWnd.set_visibleStatusbar(false);
    //will work for lightweight. In classic jQuery will not throw exceptions because of the element it cannot find
    $telerik.$(".rwStatusBar", oWnd.get_popupElement()).hide();
    var contentElem = $telerik.$(".rwContent.rwExternalContent", oWnd.get_popupElement());
    contentElem.height(contentElem.height() + 20);


    In Shinu's sample the visibility of the statusbar is toggled before the UI of the control is rendered (i.e., shown for the first time), which is why it worked. After the call to show() (or radopen() or wndManager.open(), of course) the set_visibleStatusbar(false) call will not work.

    Regards,
    Marin Bratanov
    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.
Back to Top