Setting ShowContentDuringLoad not working

1 Answer 108 Views
Window
Rolf Falnes
Top achievements
Rank 1
Iron
Rolf Falnes asked on 27 Aug 2024, 11:05 PM

Hi.

When we open a new radwindow using radopen client-side it doesn't work setting the ShowContentDuringLoad property.

Example code:

var wnd = radopen(sURL, null);
wnd.set_showContentDuringLoad(false);

 

I assume this should work ok?

Regards, Rolf

1 Answer, 1 is accepted

Sort by
0
Accepted
Vasko
Telerik team
answered on 28 Aug 2024, 07:20 AM

Hi Rolf,

I hope all is well with you!

If ShowContentDuringLoad is set to false, the Window will display a loading image that can be controlled with CSS. Now I assume the issue you're experiencing might be related to one of the following things: 

  • The rendering of the loading panel
  • External CSS stylings are applied to it
  • JavaScript errors are thrown in the console.

The easiest way to test this would be with a brand new page with only the button and window, without additional CSS or JavaScript.

Regards,
Vasko
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
Rolf Falnes
Top achievements
Rank 1
Iron
commented on 28 Aug 2024, 09:37 AM

Thanks. Yes, hope all is well with you also :)

I've now created a new Asp.Net web app project with no external css stylings applied and the problem remains - no loading image is shown during load.
Also there are no errors thrown in the console.
I've attached the project.

Regards, Rolf
Vasko
Telerik team
commented on 29 Aug 2024, 12:46 PM

Hello Rolf,

Thank you for the sample project.

The reason the loading image isn't shown is that the Window is first opened, and after that, the set_showContentDuringLoad(false) function is executed: 

function showWindow() {
    var wnd = radopen("Default2.aspx", null);
    wnd.set_showContentDuringLoad(false);
}

This approach, while it opens the Window, is not preferable if you want to customize the Window. The proper way would be to have a Window defined on the page either with the property set to false or set it to false before showing it:

<telerik:RadWindow runat="server" ID="RadWindow1" Width="500" Height="500" NavigateUrl="Default2.aspx"/>
<telerik:RadButton runat="server" OnClientClicked="OnClientClicked" ID="RadButton1" Text="Show Window" AutoPostBack="false" />

function OnClientClicked(sender, args) {
    var wnd = $find("<%= RadWindow1.ClientID %>");
    wnd.set_showContentDuringLoad(false);
    wnd.show();
}

Regards,
Author nickname
Progress Telerik

Rolf Falnes
Top achievements
Rank 1
Iron
commented on 30 Aug 2024, 07:19 AM

Ah, ok, thank you.

Regards, Rolf

Tags
Window
Asked by
Rolf Falnes
Top achievements
Rank 1
Iron
Answers by
Vasko
Telerik team
Share this question
or