recurring Events "DELETE" in Lightbox Window Issue

Hi,

I am using AJAX as my server side is in python. I am able to add recurring events with no issues.

I am having a problem with delete. Based on samples my understanding is when any of recurring event is deleted, “EventAdded” gets fired and event with rec_type = none is added with event_pid as id of master event.

This works just fine as long as Delete is executed from Pencil icons “DELETE” button.

When user tries to fire “DELETE” after opening Lightbox, “EventAdded” is not fired and “EventBeforeDelete” deletes master event(as rec_type == none is not set in event to be deleted). Can you please help? Why “EventAdded” with rec_type=“none” is not getting firedr.

scheduler.attachEvent(“onBeforeEventDelete”, function(event_id,event_object){
alert("onBeforeEventDelete " + JSON.stringify(event_object));

	data=event_id;
	
	if (event_object.rec_type == "none")
		return true; 
	
	var responseCode = ajaxPost(event_id, "Delete", data);
	
  	if ( responseCode ==  "200" )
  	{
  		//alert("Ajax success");
		return true;  	
  	}  
    	
	return false;
});

    scheduler.attachEvent("onEventAdded", function(event_id,event){
		//alert("onEventAdded :" + JSON.stringify(event));
		var rc = manage_recurring(event_id,event);
		return rc;
})

function manage_recurring(event_id,event)
{
	if (event.rec_type == "none" && event.event_pid > 0)
	{
		//alert("About to Delete recurring Event so Add to Database");
		var rc = ajaxPost(event_id, "RecurringDelete", event);
		if (rc != "200" )
			return false
	}  
	return true;
}




When you opening lightbox it can show master event or some event instance, and behavior is different for those case.

If this is master event - all serie will be deleted
If this is instance - only that instance will be deleted ( with calling onEventAdded )

When you are creating event - master lightbox is shown.
When you are clicking on details - confirm will appear and based on your selection one or another lightbox will be shown.