We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Blocking of Editing of Entire Series on certain conditions

I want to disable the editing of Entire series of a recurring appointment base on the conditions below.

1) If any of the recurring date is in the past, the editing of an entire series should be disabled. (I don't want this because editing the series will also edit the date in which the event had occurred in the past)

2) If recurring appointment has at least one of its appointments edited separately, thus the editing of the entire series should be disabled. (I also don't want this because editing the series in without this condition will affect the already edited single appointments and moreover its giving me two different results anytime I edit an entire series in which a single appointment have been edited before; Sometimes, it deletes the already edited single appointments and sometimes it doesn't, making that day to have double appointments.)

How can I achieve this.

Thanks.

1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team August 16, 2017 11:52 AM UTC

Hi Charles, 
 
Thank you for contacting Syncfusion support. 
 
Please find the below responses for your queries. 
 
Query1 
 
We have prepared the sample to prevent the entire series editing in past which can be viewed from the below link. 
 
<Code> 
function OnBeforeAppointmentChange(args) { 
    if (args.currentAction == "editSeries") { 
        if (new Date(args.appointment.changed[0].StartTime).setHours(0, 0, 0, 0) < new Date().setHours(0, 0, 0, 0)) 
            args.cancel = true 
    } 
} 
</Code> 
 
Query2 
 
We have prepared the sample to prevent the entire series editing if any one of the its occurrence is edited which can viewed from the below link. 
 
<Code> 
function OnBeforeAppointmentChange(args) { 
            if (args.currentAction == "editSeries") { 
                parentObj = new ej.DataManager(this._currentAppointmentData).executeLocal(new ej.Query().where("Id", ej.FilterOperators.equal, args.appointment.changed[0].ParentId)); 
                if (parentObj[0].RecurrenceRule.indexOf("EXDATE") != -1) 
                    args.cancel = true; 
            } 
        } 
</Code> 
 
Regards, 
Karthigeyan 
 



Loader.
Up arrow icon