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

RadConfirm Close doesn't fire callback.

1 Answer 79 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rory
Top achievements
Rank 1
Rory asked on 02 Oct 2008, 07:06 PM
Hi there, I was wondering if there is a way to prevent users from clicking the red x in a RadConfirm dialog. If not is there some way to know when they do click the red x?

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 03 Oct 2008, 02:42 PM
Hi Rory,

We are familiar with this issue and we will fix it for one of the following updates. For now you can use the following workaround:

    <form id="form1" runat="server"
 
        <script type="text/javascript"
        var confirmClosed = false
        function confirmWin() 
        { 
            var wnd = radconfirm("Sure?", callbackFn);              
             
            //Reset the flag to its default value 
            confirmClosed = false
             
            //Add on close handler to the window 
            wnd.add_close(function() 
            {                 
                //This function is called AFTER the callback function 
                //So, if the cancel or ok buttons were clicked, the callbackFn will set confirmClosed = true
                if (!confirmClosed)    
                { 
                    alert("THE USER PRESSED THE [X] BUTTON"); 
                } 
            }); 
             
        } 
         
        function callbackFn(arg) 
        { 
            alert("Result is: " + arg);  
            //Set a flag that will indicate that this callback function was invoked 
            confirmClosed = true
        } 
     
        </script> 
 
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager> 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
        </telerik:RadWindowManager> 
        <button onclick="confirmWin(); return false;"
            test</button> 
    </form> 


Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Rory
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or