|
Article relates to
|
RadWindow for ASP.NET AJAX
|
|
Created by
|
Svetlina, Telerik
|
|
Last modified
|
November 3rd, 2011
|
|
Last modified by
|
Marin Bratanov, Telerik
|
HOW-TO:
Use a custom loading sign with RadWindow
SOLUTION:
There are two common scenarios for customizing the default loading animation which is shown while the RadWindow's content page is being loaded or it is autosized - to change only the loading image or to use your own HTML element.
1) Change the loading image
In order to get the desired result you should include the image you want to display in the project and then override the default image set to the
RadWindow by using a style, similar to the below one:
2) Use your own HTML element as a loading sign
This scenario is a little bit more complex and to implement it you should go through the following steps:
- declare the element which you want to use as a loading sign and set its display to none e.g as shown below:
- override the default loading to display blank:
- handle the OnClientShow and OnClientPageLoad events to show and hide your custom loading as shown below:
Note: The provided solution with the custom loading works for the case when the loading should be shown while the content page is loading and thus you should make sure that you have ShowContentDuringLoad="false" for the RadWindow.
Note: The above code works only if the ReloadOnShow property is not set, as appendChild() removes the original content from the document. If you set this property to true a slight modification is needed that utilizes the cloneNode() method instead so that the sign appears correctly on subsequent displays of the RadWindow. You can find an example in the attached archive.
You can find a working project which demonstrate the second approach in the attached archive file.
Please
Sign In
to rate this article.