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

Change OnPopupOpening at runtime

3 Answers 35 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 14 Aug 2013, 03:33 PM
Hi there,

I use a system that makes use of the Telerik RadCalendar control. I do not have access to modify the function called on OnPopUpOpening, and it contains an error that breaks in non-IE. I was wondering if there is a way i can change the function call at runtime through javascript?

Regards,

Jack

3 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 15 Aug 2013, 11:22 AM
Hello Jack,

Well, in JavaScript you can change everything dynamically. In your case you can override the Telerik.Web.UI.RadDatePicker.prototype.raise_popupOpening function.
The current declaration of the function is
Telerik.Web.UI.RadDatePicker.prototype.raise_popupOpening = raise_popupOpening : function(args)
    {
        this.raiseEvent("popupOpening", args);
    }
If you remove the this.raiseEvent call, the client OnPopUpOpening event will not be fired.

If the object is already created, you can still change the method using code like:
$find("yourPickerClientID").raise_popupOpening = function(args)
    {
       //some new code
    }

I hope this helps.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jack
Top achievements
Rank 1
answered on 15 Aug 2013, 11:26 AM

Is $(find) stock javascript or jquery? Unfortunately im barred from using the latter.

i Managed to override the popupopening in the end, but now i'm struggling to change the assigned styles. The object is already created, with set styles applied (to DayStyle) for example. I'm unable to change the existing stylesheet, so can I assign a new style of my own to DayStyle etc. of the control?

Thanks,

Jack

0
Vasil
Telerik team
answered on 16 Aug 2013, 07:24 AM
Hello Jack,

It is not part or jQuery and nor pure JavaScript, the $find() is part  of the Sys.Application class that lays in the core of the Microsoft Ajax framework. Since our controls are based on their framework you can use it in your page.
You can examine and modify the get_stylesHash()["DayStyle"] of your RadCalendar client side if you want to change some of the styles that are applied.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Calendar
Asked by
Jack
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Jack
Top achievements
Rank 1
Share this question
or