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
close icon

Create, edit and delete events

Hi,

I am using the Schedule control and I want to create, edit an delete events. Could you help me to implements these functionalities?

Really appreciate the support,

Thanks

7 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team March 24, 2017 07:25 AM UTC

Hi Laura, 
 
Thank you for contacting Syncfusion support. 
 
We suspect that your requirement is to implement CRUD functionalities in Scheduler and for the same we have prepared the sample which can be download from the below link. 
 
In the sample when an appointment is added/edited/deleted, it will be reflected in the data base too. Kindly refer the below code example used in the sample. 
 
<Code> 
@(Html.EJ().Schedule("Schedule1") 
        .Width("100%") 
        .Height("525px") 
        .CurrentDate(new DateTime(2016, 10, 29)) 
        .AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Home/GetData").CrudURL("/Home/Batch").Adaptor("UrlAdaptor")) 
        .ApplyTimeOffset(false) 
                .Id("Id") 
                    .Subject("Subject") 
                    .StartTime("StartTime") 
                    .EndTime("EndTime") 
                    .AllDay("AllDay") 
                    .Recurrence("Recurrence") 
                    .RecurrenceRule("RecurrenceRule")) 
) 
 
</Code> 
 
Regards, 
Karthigeyan 
 
 



LJ Laura Jordan March 27, 2017 04:00 PM UTC

Hi,

I am facing an issue when trying to create an event by single clicking...I am getting the Subject value as NULL, because does not show the option of setting a subject.

Also I want to disable the Recurrence option when created an event.

Can you help me? 

Thanks for the support,


KK Karthigeyan Krishnamurthi Syncfusion Team March 28, 2017 10:40 AM UTC

  
Thanks for your update.  
 
Before opening an appointment window, AppointmentWindowOpen event will be raised where the default window can be customized. Kindly include the below code example in your sample to disable the recurrence option in the appointment window. We have prepared the below sample for your easy reference in JS platform. 
 
<Code> 
.ScheduleClientSideEvents(evt=> 
   evt .AppointmentWindowOpen("onAppointmentWindowOpen")) 
 
function OnAppointmentWindowOpen(args) {   
        $("#" + this._id + "recurrence").ejCheckBox("disable"); 
        $(".e-repeatlbl").closest('td').addClass("e-disable"); 
    } 
</Code> 
 
We are not clear about your first requirement, kindly share the image/video demo which clearly depicts the issue to proceed further. 
 
Regards,  
Karthigeyan  
 
 



LJ Laura Jordan March 28, 2017 06:33 PM UTC

Hi,

Thanks for the update, but when I double click any Schedule cell to create an event it still appear the Repeat checkbox option. I want to disable that option for the user when try to create an appointment by clicking or double clicking.

Best regards.


KK Karthigeyan Krishnamurthi Syncfusion Team March 29, 2017 05:33 AM UTC

   
Thanks for your update   
   
In our previous sample, recurrence option (Repeat field) is disabled in appointment window as per your requirement and for the same we have prepared the below video demo. Kindly ensure that previous update code example is used in your example and if your requirement is to hide the recurrence option (Repeat field) in appointment window, kindly use the below code example and for the same below sample is prepared.   
 
<Code> 
.ScheduleClientSideEvents(evt=>  
       evt .AppointmentWindowOpen("onAppointmentWindowOpen"))  
  
function OnAppointmentWindowOpen(args) {   
            $("#"+this._id+"recurrence").closest('td').css("display","none"); 
            $(".e-repeatlbl").closest('td').css("display","none"); 
        } 
</Code> 
 
If the above sample doesn’t meet your requirement, kindly share the image/video demo which clearly depicts your requirement to proceed further.   
   
Regards,   
Karthigeyan   



LJ Laura Jordan March 29, 2017 06:45 PM UTC

Hi,

Thanks for the support, I notice that the problem was the name of  the event function.
In the first example the code function name was .AppointmentWindowOpen("onAppointmentWindowOpen")). But in the javascript code it was OnAppointmentWindowOpen so it did not match. Now I change it, and it works as expected.

Best regards.


KK Karthigeyan Krishnamurthi Syncfusion Team March 30, 2017 04:18 AM UTC

    
We are happy that our solution has fulfilled your requirement. 
 
Please let us know if you need further assistances.  

Regards, 
Karthigeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon