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

Edit, but not add or delete

Hi,

I'd like to use the schedule widget to allow users to edit events (including dragging / resizing), but not to add or delete them (those will be handled by different parts of the application).

Is there any way to do this?

Thanks,
-Chris

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team June 24, 2019 07:24 AM UTC

Hi Chris, 
 
Syncfusion greetings. 
 
Yes, actionBegin event can be used to achieve your requirement. 
 
onActionBegin(args: ActionEventArgs): void { 
    if (args.requestType === "eventRemove" || args.requestType === "eventCreate") { 
      args.cancel = true; 
    } 
  } 
 
Regards, 
Karthi 
 



CC Chris Cunningham June 24, 2019 09:25 PM UTC

Hi, 

Using actionBegin does stop the add or save action itself from happening, but the UI still acts like it allows add and save up to that point. It looks like I can clean up the add UI by cancelling cellClick and cellDoubleClick. Any suggestion on removing delete from the UI?

Thanks,
-Chris



KK Karthigeyan Krishnamurthi Syncfusion Team June 25, 2019 08:37 AM UTC

Hi Chris, 
 
Thanks for the update. 
 
We have modified our previous sample to achieve all your requirements using popupOpen event. 
 
onPopupOpen(args: PopupOpenEventArgs): void { 
    if (args.target.classList.contains("e-work-cells")) { 
      args.cancel = true; 
      return; 
    } 
    var buttonElement = args.type === "QuickInfo" ? ".e-event-popup .e-delete" : ".e-schedule-dialog .e-event-delete"; 
    var deleteButton = document.querySelector(buttonElement); 
    if (deleteButton && (deleteButton as EJ2Instance).ej2_instances) { 
      ((deleteButton as EJ2Instance).ej2_instances[0] as Button).disabled = true; 
    } 
  } 
 
Regards, 
Karthi 


Loader.
Live Chat Icon For mobile
Up arrow icon