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

Retrieving RecurrenceRule in Javascript

8 Answers 175 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
SMC
Top achievements
Rank 1
SMC asked on 04 Aug 2008, 01:44 PM
Hi

I was just wondering if there is a way of retrieving the recurrence rule in javascript when you edit an appointment. I want to retireve it while inside the advanced edit form. Something like get_recurrenceRule().

8 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 05 Aug 2008, 07:06 AM
Hello abdul gabier,

At the time being the recurrence rule is not available from the client-side.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob Schrum
Top achievements
Rank 1
answered on 25 Mar 2010, 06:48 PM
Is this still the case for the 2009 Q3 release?

-Bob
0
Roatin Marth
Top achievements
Rank 1
answered on 25 Mar 2010, 08:03 PM
The latest client-side Appointment class does have a recurrenceRule property, which returns the recurrence rule string in RFC2445 format.

It's accessible as:

appointment.get_recurrenceRule();

0
T. Tsonev
Telerik team
answered on 26 Mar 2010, 10:44 AM
Hi,

In addition to what Roatin said, you can also parse the recurrence rule on the client using the Telerik.Web.UI.RecurrenceRule.parse method. You cannot generate occurrences on the client.

Kind regards,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ramya
Top achievements
Rank 1
answered on 17 Sep 2012, 09:25 AM
Hi,
Iam new to telerik. How can i

RetrieveRecurrenceRule in Javascript


i have the below code in my project

 var editor = $('#<%=AppointmentRecurrenceEditor.ClientID%>');
    var recurStartDate = info.StartDateTime;
    var recurEndDate = info.EndDateTime;

    editor.StartDate = recurStartDate;
    editor.EndDate = recurEndDate;
    var rrule = editor.get_recurrenceRule();

But the console shows an error saying that editor.get_recurrenceRule() is  not a function. Kindly advise on how to proceed.

Thanks
Ramya
0
Boyan Dimitrov
Telerik team
answered on 18 Sep 2012, 10:25 AM
Hello Ramya,

Please find the attached sample project that shows retrieving recurrence rule of an appointment using JavaScript and OnClientFormCreated event. This project is based on our Code Library for customizing Advanced Form with Advanced Form template user controls and this help article for accessing Advanced Form elements using jQuery.  By just adding this JavaScript code you are able to retrieve and use your recurrence rule:

//aspx file

<telerik:RadScheduler runat="server" ID="RadScheduler1"  OnClientFormCreated="schedulerFormCreated"
            .............
</telerik:RadScheduler>

//JavaScript
function schedulerFormCreated(scheduler, eventArgs) {
            var $ = $telerik.$;
             
            // Create a client-side object only for the advanced templates
            var mode = eventArgs.get_mode();
            if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
                    mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
                var editorjQueryObject = $("[id$='AppointmentRecurrenceEditor']");
                var editor = $find(editorjQueryObject.attr("id"));
 
                if (editor.get_recurrenceRule() != null) {
                    var recurrenceRule = editor.get_recurrenceRule();
                    alert(recurrenceRule);
                }
.................
}

I hope this will be helpful.


Kind regards,
Boyan Dimitrov
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.
0
Ramya
Top achievements
Rank 1
answered on 11 Oct 2012, 12:32 PM
Hi,

How can i set date to end by calendar . Though i able to set the date to the end by date input box, the shared calendar is always displaying the current date. How can i set date thru client side to the end by calendar.

Ramya
0
Princy
Top achievements
Rank 2
answered on 15 Oct 2012, 08:53 AM
Hi Ramya,

I suppose you want to set the End by date from the client side. Following is the sample code that I tried.

ASPX:
<telerik:RadScheduler runat="server" ID="RadScheduler1" AdvancedForm-Modal="true" OnClientFormCreated="OnClientFormCreated">        
</telerik:RadScheduler>

JS:
<script type="text/javascript">
 function OnClientFormCreated(sender, args) {
        var $ = $telerik.$;
        var mode = args.get_mode();
        if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert || mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
            var recurrenceEditorJqueryObj = $("[id$='RangeEndDate']");
            var recurrenceEditor = $find(recurrenceEditorJqueryObj.attr("id"));
            var today = new Date("October 20, 2012 11:13:00");
            recurrenceEditor.set_selectedDate(today);
 
        }
    }
</script>

Hope this helps.

Regards,
Princy.
Tags
Scheduler
Asked by
SMC
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Bob Schrum
Top achievements
Rank 1
Roatin Marth
Top achievements
Rank 1
T. Tsonev
Telerik team
Ramya
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Princy
Top achievements
Rank 2
Share this question
or