rsRecurrenceOptionList click event and selected item

4 posts, 0 answers
  1. Fred
    Fred avatar
    7 posts
    Member since:
    Jan 2011

    Posted 11 Apr 2013 Link to this post

    How can i capture the click event on client side whenever the rsRecurrenceOptionList is clicked?

    I want to be able to capture the click and get the selected item to hide or show a custom panel with controls.

    Thanks.
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 16 Apr 2013 Link to this post

    Hi Fred,

     
    You can easily achieve it with the following code by using onClientFormCreated event of RadScheduler:

    function OnClientFormCreated(sender, args) {
                   var $ = $telerik.$;
                   $(".rsRecurrenceOptionList ").on("click", function myfunction() {
                       alert(1);
                   });
               }

    Hope this will be helpful.

    Kind regards,
    Plamen
    the Telerik team
    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 their blog feed now.
  3. Fred
    Fred avatar
    7 posts
    Member since:
    Jan 2011

    Posted 16 Apr 2013 Link to this post

    Thanks for response.  I have the following scripts on the page

    function pageLoad() {

    var $ = $telerik.$;

    $(

    ".RecurrenceEditor").children().each(function(i) {

    if (i == 0)

    $($($(

    this).children()[0]).children()[0]).attr("checked", "checked");

    else if (i == 1)

    this.style.display = "block";

    });

    var rruleControl = parent.document.getElementById("hdnRRule");

    var rrule;

    if (rruleControl != null) {

    rrule = rruleControl.value;

    if (!!rrule) {

    var recurrenceEditorJQuery = $("[id$='RecurrencePatternEditor']");

    var recurrenceEditor = $find(recurrenceEditorJQuery.attr("id"));

    if (recurrenceEditor != null) {

    recurrenceEditor.set_recurrenceRule(rrule);

    }

    }

    }

    }

    function OnClientFormCreated(sender, eventArgs) {

    $telerik.$(

    ".rsAdvRecurrenceRangePanel .rsAdvOptionsPanel ul li:first-child").hide();

    $telerik.$(

    ".rsRecurrenceOptionList").on("click", function selecteditemclick() {

    alert(1);

    });

    }


    The alert does not fire.

    I also have a second issue.  When i try to set the recurrence rule for the radschedulerrecurrenceeditor control using
    recurrenceEditor.set_recurrenceRule(rrule);  I get an error "Microsoft JScript runtime error< Object doesn't support property or method 'get_pattern'  >

    I have EnableEmbeddedScript = "true" so its using the embedded script in the Telerik.Web.UI

    My current version of Telerik.Web.UI.dll is 2012.2.724.35

    Is the embedded script for RecurrenceEditor.js or RecurrenceRule.js missing that method?  I think it's the latter, because the get_pattern is being called on the recurrence rule.

  4. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 18 Apr 2013 Link to this post

    Hi Fred,

     
    I have tested the scenario you described but could not observe any unusual behavior. I am attaching my test web page. Would you please review it and let us know if your scenario is somehow different so we could be more helpful?
     

    Greetings,
    Plamen
    the Telerik team
    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 their blog feed now.
Back to Top