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

On date click in Agenda view, open popup

Hi,

I try with onRenderCell to add a Class to the dateHeader. But the onRenderCell is not fired in the Agenda view. 
What i'm trying to achieve is to open the create appointment popup when you click on the date in the Agenda view instead of navigating to the Day view.

Is there a way to do this?

1 Reply

VD Vinitha Devi Murugan Syncfusion Team March 27, 2019 12:47 PM UTC

  
Thank you for contacting Syncfusion support.  
   
We have prepared the below sample to open the editor window when click on the date in agenda view. 

   
  created() { 
    document.addEventListener("mouseup", this.mouseUp); 
  }, 
  beforeDestroy() { 
    document.removeEventListener("mouseup", this.mouseUp); 
  }, 
  methods: { 
    mouseUp: function(args) { 
      if (args.target.classList.contains("e-m-date")) { 
        let scheduleObj = document.getElementById("Schedule").ej2_instances[0]; 
        let startDate = new Date( 
          parseInt(args.target.parentElement.parentElement.getAttribute("data-date")) 
        ); 
        let endDate = new Date(startDate); 
        endDate = new Date(endDate.setMinutes(endDate.getMinutes() + 30)); 
        let data = { startTime: startDate, endTime: endDate }; 
        scheduleObj.openEditor(data, "Add"); 
      } 
    } 
  
  
Regards,  
M.Vinitha devi 



Loader.
Live Chat Icon For mobile
Up arrow icon