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

SchedulerAppointment.clone() doesn't clone the recurrence rule?

1 Answer 32 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 14 Apr 2013, 11:58 AM
Hi guys,

We noticed that the client-side clone() method for a SchedulerAppointment does not seem to clone the recurrence rule.

The definition of the function as we see it in your build 2013.1.220.45 is (minified)

clone:function(){var h=new b.SchedulerAppointment();
h._id=this._id;
h._subject=this._subject;
h._description=this._description;
h._start=this._start;
h._end=this._end;
h._toolTip=this._toolTip;
h._internalID=this._internalID;
h._visible=this._visible;
h._recurrenceState=this._recurrenceState;
h._recurrenceParentID=this._recurrenceParentID;
h._contextMenuID=this._contextMenuID;
h._resources=this.get_resources().clone();
h._attributes=this.get_attributes().clone();
if(this.get_reminders){h._reminders=this.get_reminders().clone();
}for(var i in this){if(h[i]===g&&!i.startsWith("_")){h[i]=c(this[i]);
}}return h;
}

I would have expected a line something like:

h.set_recurrenceRule(this.get_recurrenceRule());

Is there a reason why the recurrence rule isn't cloned?

Cheers,
Sam




1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 17 Apr 2013, 10:31 AM
Hi Sam,

 
Thank you for pointing this issue. I have logged it for investigation and possible implementation. Meanwhile you can use the following code to workaround it:

function OnClientAppointmentClick(sender, args) {
          var appointment = args.get_appointment();
          var newAppointment = appointment.clone();
          newAppointment.set_recurrenceRule(appointment.get_recurrenceRule());
          sender.insertAppointment(newAppointment);
      }

Hope this will be 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.
Tags
Scheduler
Asked by
Sam
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or