ejScheduler track selected appointment

is the re any way to track the currently selected appointment?

4 Replies

NR Nevitha Ravi Syncfusion Team October 13, 2017 12:24 PM UTC

Hi Michael, 

Thank you for contacting Syncfusion Support. 

Yes, it is possible to get the selected appointment using appointmentClick event. We can get the appointment from args.appointment and for the same we have prepared a sample for your reference which can be viewed from the below link. 
 

<Code> 
$("#Schedule1").ejSchedule({ 
    width: "100%", 
    height: "525px", 
    currentDate: new Date(2017, 5, 5), 
    appointmentClick: "onAppointmentClick", 
    appointmentSettings: { 
          dataSource: dManager, 
          id: "Id", 
          subject: "Subject", 
          startTime: "StartTime", 
          endTime: "EndTime", 
          description: "Description", 
          allDay: "AllDay", 
          recurrence: "Recurrence", 
          recurrenceRule: "RecurrenceRule" 
     } 
}); 
function onAppointmentClick(args) { 
   appoint = args.appointment; //appoint has the selected appointment  
} 
 </Code> 
 
UG Link: https://help.syncfusion.com/api/js/ejschedule#events:appointmentclick 

Regards, 
Nevitha. 
 



MS Michael Salzlechner October 13, 2017 02:54 PM UTC

yes I know i can get it inside appointmentClick but how do I know when it changes and gets unselected?



MS Michael Salzlechner October 16, 2017 12:29 PM UTC

not really what i wanted. here is the senario

user selects and appointment. onAppointmentClick is called and i can remember the selected appointment

now there are a number of ways that the selected appointment could be unselected

mouse actions on parts of the scheduler that are not appointments

scrolling dates

deleting the selected appointment

it would be great to have an even onAppointmentSelected that is called whenever an appointment is selected and also when the appointment is unselected for any reason




NR Nevitha Ravi Syncfusion Team October 17, 2017 04:33 AM UTC

Hi Michael, 

We are sorry to inform you that, currently it is not possible to find the unselected appointment using any built-in events of Schedule, but based on the requirement, we can try to achieve it through any work around possibilities.  

For now, we have prepared a sample to find the previously selected appointment (that is, the currently unselected appointment) while clicking on other appointments, which can be viewed from the below link. 

<Code> 
        function onAppointmentClick(args) { 
            var schObj = $("#Schedule1").ejSchedule("instance"); 
            if (Appointment.length > 0) { 
                //previously selected appointment element will be stored on 'Appointment' 
            } 
            Appointment = $(schObj.element.find(".e-selectedAppointment")); //to get selected appointment element 
 
        } 
</Code> 

In the above sample, we can get the unselected appointment only when we select another appointment(on appointment click) on UI .Therefore, we request you to kindly revert us back with your exact scenario, when you want to track the particular unselected appointment, so that we can check for the possibility of workaround solution. 

Regards, 
Nevitha.

Loader.
Up arrow icon