How to remove default resource from the Edit window when creating a new event

Hi,

I am using the Schedule with resources (allowMultiple: true) and when creating a new event with the Event Editor window the first resource is always the default selected. See attached screenshot.  How do I change it so there is no default?  I want this field to be optional with no default and when the user saves an empty resources array is passed to the dataSource.


Thanks
Derrick

5 Replies 1 reply marked as answer

PN Praveenkumar Narasimhanaidu Syncfusion Team February 3, 2021 01:46 PM UTC

Hi Derrick, 

Greetings from Syncfusion support. 

We have validated your requirement and let you know that we can achieve this requirement by using popupOpen event. We have also prepared sample for your reference which is available in below link. 


App.component.ts 

  onPopupOpen(args: PopupOpenEventArgs): void { 
    if (args.type === "Editor") { 
      var multiSelect = args.element.querySelector(".e-OwnerId.e-multiselect") 
        .ej2_instances[0]; 
      multiSelect.value = ""; 
    } 
  } 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Praveenkumar. 


Marked as answer

DE Derrick February 3, 2021 06:05 PM UTC

Praveenkumar,

That solution worked well for setting the default.  thanks.

I only want set the default when adding a new event but not when editing an event.  From the popupOpen event how do I determine if action is an 'Add' vs 'EditOccurence' or 'EditSeries' ?

thanks
Derrick


PN Praveenkumar Narasimhanaidu Syncfusion Team February 4, 2021 03:49 PM UTC

Hi Derrick, 

Thanks for the update. 

We have validated your requirement and let you know that we can get those actions using  scheduler currentAction property. For the same, We have also modified sample for your reference which can be available from below link. 


App.component.ts 
onPopupOpen(args: PopupOpenEventArgs): void { 
    if (args.type === "Editor") { 
      if (!(this.scheduleObj.currentAction == "Add")) { 
        var multiSelect = args.element.querySelector(".e-OwnerId.e-multiselect") 
          .ej2_instances[0]; 
        multiSelect.value = ""; 
      } 
    } 
  } 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Praveenkumar. 
 



DE Derrick February 4, 2021 04:13 PM UTC

that's exactly what I was looking for.  thanks!



NR Nevitha Ravi Syncfusion Team February 5, 2021 05:27 AM UTC

Hi Derrick, 

You are most welcome..! please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon