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

radconfirm callback funtion not found

2 Answers 175 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 03 Aug 2018, 08:34 PM

I have been struggling to get the callback function to be recognized.  My situation is that I have a javascript function that executes when a user clicks a button.  This function contains code similar to the following to open the radconfirm prompt window

 var oManager = GetRadWindowManager();
    oManager.radconfirm(pMsg, "returnFunction",400,300,"Popup Title");

 

When the user clickes either the Ok or Cancel button the following error occurs.

JavaScript runtime error: Function expected

 

The function returnFunction(arg) exsits in the same javascript file but is not recognized.

Any ideas as to the issue.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 06 Aug 2018, 03:56 PM
Hello Andy,

When called from JavaScript, the radconfirm() method takes a function object for the callback function. It takes a string when called from the code-behind. Reference to the full functionality of the widget: https://docs.telerik.com/devtools/aspnet-ajax/controls/window/alert,-confirm,-prompt-dialogs/radconfirm-dialog.

Here's an example:

<script type="text/javascript">
    function confirmCallBackFn(arg) {
        radalert("Confirm returned the following result: " + arg);
    }
    function callRadConfirm() {
        radconfirm('Are you sure?', confirmCallBackFn); //no quotes around the callback function object reference
    }
</script>
<asp:Button Text="call RadConfirm" ID="Button1" OnClientClick="callRadConfirm(); return false;" runat="server" />
<telerik:RadWindowManager runat="server" ID="rwm1" RenderMode="Lightweight"></telerik:RadWindowManager>


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andy
Top achievements
Rank 1
answered on 06 Aug 2018, 06:22 PM
Thanks for the quick response.  This explanation fixed my issue.
Tags
Window
Asked by
Andy
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Andy
Top achievements
Rank 1
Share this question
or