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

OnPopupClosing does not fire when clicked outside popup

8 Answers 141 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Lambros
Top achievements
Rank 1
Lambros asked on 08 May 2009, 11:20 AM
When i use the OnPopupClosing event handler it fires only when some date is selected in the popup, but not when popup is closed due to the clicking outside it. How can i process the popup closing if no date was selected in it?

8 Answers, 1 is accepted

Sort by
0
Lambros
Top achievements
Rank 1
answered on 12 May 2009, 12:02 PM
it would be nice if Telerik team paid some attention to this problem
0
Georgi Krustev
Telerik team
answered on 12 May 2009, 02:23 PM
Hello Lambros,

To attain this unsupported scenario you need to prototype PopUp's OnClick event. Here is a code snippet showing how to achieve this:
        <telerik:RadDatePicker runat="server" ID="Pciker"
            <ClientEvents OnPopupClosing="function(){alert(1);}" /> 
        </telerik:RadDatePicker> 
 
        <script type="text/javascript"
        Telerik.Web.UI.Calendar.Popup.prototype.OnClick = function(e) { 
        this.Opener.hidePopup(); 
        }  
        </script> 

Note that the Javascript code should be placed after the RadDatePicker control.

Kind regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
IBS Support Team
Top achievements
Rank 1
answered on 18 Jun 2009, 07:18 AM
Hi Georgi,

What is the equivalent fix for the ASP.Net version of the control? I am hiding a combo box to work around an ie6 bug (where the combo shows through floating elements) and using the popup open and close events. I need to know when the calendar disappears regardless of whether it is by clicking a date, clicking the calendar button, or clicking away from the control.

Thanks
0
Princy
Top achievements
Rank 2
answered on 18 Jun 2009, 08:22 AM
Hello Jason,

Try the following client-side code if you are using ASP.NET version of RadControls.

JavaScript:
 
<script type="text/javascript">  
    RadCalendarNamespace.Popup.prototype.OnClick = function(e){this.Opener.HidePopup()};  
</script> 

Thanks,
Princy.
0
Cori
Top achievements
Rank 2
answered on 11 Mar 2011, 03:39 PM
Hello Lambros,

Why is this not the default behaviour for this event? When you click outside of it the popup closes, shouldn't it also raise the event when this happens?
0
Sean
Top achievements
Rank 2
answered on 06 Jun 2011, 06:02 PM
Hi Telerik,

I have two RadDateTimePickers. Each one fires a different event based on OnPopUpClosing and OnPopUpOpening. If I click on the first RadDateTimePicker and open a PopUp its OnPopUpOpening event fires. Click anywhere off of it causes the OnPopUpClosing to fire, except when I click on the other RadDateTimePicker (causing an OnPopUpOpening event to fire). How can I cause the first picker's OnPopUpClosing to fire before the second's OnPopUpOpening?

Thanks

(I'm using the above code to achieve the effect of closing when clicking away from the pop-up)
0
Iana Tsolova
Telerik team
answered on 07 Jun 2011, 01:02 PM
Hi Sean,

Could you please confirm you are using the latest version of the RadControls for ASP.NET AJAX? It is labeled 2011.1.519.

Kind regards,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Sean
Top achievements
Rank 2
answered on 07 Jun 2011, 05:57 PM
Hey, I was not and the latest version resolved these issues. Thanks.
Tags
Calendar
Asked by
Lambros
Top achievements
Rank 1
Answers by
Lambros
Top achievements
Rank 1
Georgi Krustev
Telerik team
IBS Support Team
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Cori
Top achievements
Rank 2
Sean
Top achievements
Rank 2
Iana Tsolova
Telerik team
Share this question
or