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

RadWindowManager.RadAlert callbackFnName

2 Answers 421 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chen
Top achievements
Rank 1
Chen asked on 23 Mar 2011, 06:17 PM
V Q1/2011

I could not find in the documentation an explanation for the callbackFnName parameter of RadWindowManager.RadAlert.
It works for me when I have null there, but I am just guessing.


2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Mar 2011, 06:14 AM
Hello Chen,

you need to get a reference to the radalert object and then use the ASP.NET AJAX add_close() function to hook to its close event. Here is a sample code.

aspx:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
<button onclick="callAlert(); return false;">call radalert</button>
Javascript:
<script type="text/javascript">
function callAlert()
        {
            //get a reference to the radalert object
            var oWnd = radalert("radalert text");
            //add a closing function to it
            oWnd.add_close(closingFn);
        }
           
function closingFn()
        {
            //execute your code
            alert("closed");
        }
</script>

Thanks,
Shinu.
0
Svetlina Anati
Telerik team
answered on 24 Mar 2011, 09:44 AM
Hello Chen,

 We recently introduced callback function for radalert and it works just as the ones of radconfirm and radprompt. The parameter has the name of a client - side function which will get executed just after the alert is closed. In addition, by checking the argument there you can determine whether the alert was closed through the OK button or the [X] button.

More detailed explanation is available in the Description tab of the demo below:

http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx

We will soon update our online documentation with the new features which were added - this is already in our TODO list.

I hope that my reply is helpful, let me know if you have additional questions.

Greetings,
Svetlina
the Telerik team
Tags
Window
Asked by
Chen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or