Events Overview
RadAjaxLoadingPanel contains the following client events:
Name | Description |
---|---|
OnClientShowing | Fired before the loading panel is shown. |
OnClientHiding | Fired before the loading panel hides. |
To use these events, simply write a JavaScript function that can be called when the event occurs(Example 2 ).You then assign the name of the JavaScript function as the value of the the corresponding property.
Example 2: Cancel the default behavior when shows and hides the RadAjaxLoadingPanel and apply a custom behavior for both actions.
<script type="text/javascript">
function MyClientShowing(sender, eventArgs) {
eventArgs.get_loadingElement().style.border = "2px solid red";
eventArgs.set_cancelNativeDisplay(true);
$telerik.$(eventArgs.get_loadingElement()).show("slow");
}
function MyClientHiding(sender, eventArgs) {
eventArgs.get_loadingElement().style.border = "2px solid blue";
eventArgs.set_cancelNativeDisplay(true);
$telerik.$(eventArgs.get_loadingElement()).hide("slow");
}
</script>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackColor="yellow"
OnClientShowing="MyClientShowing" OnClientHiding="MyClientHiding" />