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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Edit, but not add or delete

Thread ID:

Created:

Updated:

Platform:

Replies:

145462 Jun 24,2019 02:37 AM UTC Jun 25,2019 08:37 AM UTC Angular - EJ 2 3
loading
Tags: Schedule
Chris Cunningham
Asked On June 24, 2019 02:37 AM UTC

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

Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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 
 


Chris Cunningham
Replied On 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


Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon