Delete Recurring Event Occurence Issue- sample code provided

Hi I really like the Scheduler.
I just have a small problem with deleting one occurence of a recurring event. In the attached html sample you’ll see I have these events (n.b. you’ll need to set the paths to the dhtmlxscheduler correctly in the and tags up the top)

A recurring event, occuring weekly (every friday):
scheduler.addEvent({
id:‘265’,
start_date: ‘01-08-2011 00:00’,
end_date: ‘02-02-2037 00:00’,
rec_type: ‘week_1___5#no’,
text:‘not today’,
event_length:‘86400’,
event_pid: 0
});

A removal of one occurence on Fri 19th of August
scheduler.addEvent({
id:‘266’,
start_date: ‘19-08-2011 00:00’,
end_date: ‘20-08-2011 00:00’,
rec_type: ‘none’,
text:‘not today’,
event_length:‘1313676000’,
event_pid: ‘265’
});

I get the error: TypeError: ‘undefined’ is not a function (evaluating ‘scheduler.date[“transpose_”+ev.rec_pattern](td, from)’)

Seems like the repeat_date(ev,stack,non_render,from,to) function is being called for the rec_type:‘none’ event because the rec_pattern != ‘none’ when the check is made in get_visible_events, but if I explicitly set rec_pattern: ‘none’ when creating the event, the occurence on the 19th is displayed and not deleted.

Would love to know why this problem is occurring. In the sample code of dhtmlx_scheduler v3 the events are loaded via xml using the load() function and this functionality (deleting an occurence) works fine. I wonder if it is because I am loading my events using explicit scheduler.addEvent(); calls that this problem is happening.

Also timezone is GMT +10 in my setup, and GMT+11 in the working example code, not sure if that has any bearing whatsoever, but thought I might mention it just in case.

Thanks kindly in advance for any assistance.
Joel
schedule_recurr_problem.html.zip (5.03 KB)

Change your code as

var nev = {
id:‘266’,
start_date: ‘19-08-2011 00:00’,
end_date: ‘20-08-2011 00:00’,
rec_type: ‘none’,
rec_pattern: ‘none’, //need to be added
text:‘not today’,
event_length:‘1313676000’,
event_pid: ‘265’,
section_id:‘7’
};
scheduler.addEvent(nev);
scheduler._add_rec_marker(nev, 1313676000*1000); //used to apply exception

Fantastic, thanks Stanislav! Everything works perfectly now.

Notes for others viewing this, I did the steps Stanislav advised for all events with event_pid != ‘0’
ie. added the rec_pattern to the event (gave it the same value as the rec_type) and after adding the event I called scheduler._add_rec_marker(nev, parseInt(nev.event_length)*1000);

Ok thanks again for the prompt help!