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

ShowContentDuringLoad progress indicator

1 Answer 96 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 13 Jul 2011, 02:04 PM
Hi there!

1.
When the RadWindowManager property "ShowContentDuringLoad" is set to false and I open a radwindow, I get this awesome spinning progress indicator that looks like the same graphic as when I use a RadAjaxLoadingPanel.
2.
For my RadWindowManager, I also have the "Reload" behavior active.  so when I click the "reload" icon in the upper right of the radwindow titlebar, I see the same awesome spinning progress indicator.
3.
My page loads into the RadWindow and the awesome spinning progress indicator goes away.
4.
Something on my page triggers a postback.
5.
No awesome spinning progress indicator!!!

So my question is, is there a way for me to trigger the awesome spinning progress indicator when my page (the content inside a RadWindow) does a postback?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 Jul 2011, 03:48 PM
Hi Sam,

The Reload button essentially does a location.reload() of the iframe, in which your page is loaded, while a simple postback does not. We also move the iframe out of the viewport for visual appeal. This is the reason why the loading sign is not displayed while you are simply working with the page.

What I can suggest is that you attach a handler to the client click event of the button that would trigger a postback and in it - call a function from the main page that will show a RadAjaxLoadingPanel in the RadWindow. This panel will be hidden by a function call in the window.onload event of the content page (or any other suitable, depending on your requriements). For your convenience I created and attached a simple page illustrating the approach.

  Another possible approach is to use CSS and add the CSS class that show the loading image in the RadWIndow cell. This one is lighter and does not requrie additional controls, yet it is more difficult to implement correctly and I cannot guarantee that it will work in all browsers and cases, as the window.onbeforeunload event is rather unreliable. Nevertheless I left this approach in the pages (if yo wish to examine and further enhance it), but it is commented out.


Best wishes,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Window
Asked by
Sam
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or