Copy/Paste with recurring event

Hello,

In my scheduler, if i copy-paste a recurring event, i obtain a bug if i refresh the scheduler.
When i refresh it, i have the loading progress bar but nothing else…
When i look to the Firebug extension console i have this error on the dhtmlxscheduler_recurring.js :

TypeError: scheduler.date[("transpose_" + a.rec_pattern)] is not a function ...attern);for(scheduler.date["transpose_" + a.rec_pattern] (e,d);e<a.start_date||sche...

Any idea to resolve this ?

Can you provide the exact steps, how to reconstruct issue ?
Is it occurs for default sample or only for some custom init ?

I have inserted this code to enable to copy/paste :

[code]scheduler.attachEvent(“onEventCopied”, function(ev) {
dhtmlx.message(“Vous avez copié l’événement :
“+ev.text+””);
modified_event_id = ev.id;
scheduler.updateEvent(ev.id);
});
scheduler.attachEvent(“onEventCut”, function(ev) {
dhtmlx.message(“Vous avez coupé l’événement :
“+ev.text+””);
modified_event_id = ev.id;
scheduler.updateEvent(ev.id);
});

	scheduler.attachEvent("onEventPasted", function(isCopy, modified_ev, original_ev) {
			modified_event_id = null;
			scheduler.updateEvent(modified_ev.id);

			var evs = scheduler.getEvents(modified_ev.start_date, modified_ev.end_date);
			if (evs.length > 1) {
				dhtmlx.modalbox({
					text: "Il y a déjà un événement à ce moment ! Que voulez-vous faire ?",
					width: "500px",
					position: "middle",
					buttons:["Annuler", "Modifier l'événement", "Confirmer"],
					callback: function(index) {
						switch(+index) {
							case 0:
								if (isCopy) {
									// copy operation, need to delete new event
									scheduler.deleteEvent(modified_ev.id);
								} else {
									// cut operation, need to restore dates
									modified_ev.start_date = original_ev.start_date;
									modified_ev.end_date = original_ev.end_date;
									scheduler.setCurrentView();
								}
								break;
							case 1:
								scheduler.showLightbox(modified_ev.id);
								break;
							case 2:
								return;
						}
					}
				});
			}
		});[/code]

I’ve seen that when the problem occured, in the database, the field rec_type have the string value “null” (the field is not null, there is the string “null” in it).

Problem confirmed and fixed, please try to use the attached js file instead of the original one.
dhtmlxscheduler_key_nav.zip (889 Bytes)

Hello,

Thanks for this update.
I have another problem :
when i cpy/paste an event, it only copy/paste the title and duration of the event. Other fields are not pasted.
Any idea ?

Is it occurs for all event or only for recurring ones ?

It occurs only for recurring events

This is expected, you can use onEventPasted to set extra details

scheduler.attachEvent("onEventPasted", function(copy, new_ev, ev){ if (copy) new_ev.some = ev.some; });

That resolve my problem.
Thanks a lot