Change OnPopupOpening at runtime

4 posts, 0 answers
  1. Jack
    Jack avatar
    2 posts
    Member since:
    Aug 2013

    Posted 14 Aug 2013 Link to this post

    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
  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 15 Aug 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jack
    Jack avatar
    2 posts
    Member since:
    Aug 2013

    Posted 15 Aug 2013 Link to this post

    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

  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 16 Aug 2013 Link to this post

    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.
Back to Top