Sequential appointments or lead time
Hi - I have a scenario where appointments have lead time, e.g. an appointment is 8-9, 915-1015, 1030-1130 but it has prep/lead time attached to e.g. 7:45-8, 9:00-9:15 and 10:15-1030
This needs to not be part of the appointment time but is almost like a block of time attached to it.
I've tried to cater for this by adding the time into the start time, then using css to show the first x minutes differently, but unfortunately that creates problems with drag and drop where the drag handler is based on the 7:45 start not 8:00.
Is there any way to achieve having lead time on an appointment show visually e.g. a different color, OR have two apopointments be "stuck" together so if I drag one it drags the other?
Example of visual difference I tried:
Hi John,
You can achieve your requirement by increasing the start time in the Schedule's dragStop event. If you are still facing the same issue, share the below details to proceed further.
Api: https://ej2.syncfusion.com/vue/documentation/api/schedule#dragstop
- Entire schedule related code with the sample end customization and appointment details or
- Issue reproducing sample.
Regards,
Swathi Ravi
Thanks for the reply - unfortunately I can't really create a sample here as I don't know if what I'm asking for is a feature.
I don't think what you linked addresses the problem so I will try articulate it clearer.
I have a schedule that is:
- 9-10 - 0 travel time
- 10:20-11:20 - 20 minutes travel time
- 11:50-12:50 - 30 minutes travel time
- Have the time shown
- Have two appointments one representing the time and one the actual event, have the time not be draggable (I can use onDragStart for this), but have the time move with the appointment/be stuck to it
Hi Jon,
We have created a sample with your shared details. You can achieve your requirement by using the Schedule select and eventClick event like the below shared snippet.
Note: CTRL + Click on the appointment Meeting and then drag. You can click and drag on the main appointment(Meeting) only and not the lead time appointment.
Sample: https://stackblitz.com/edit/2r2c73-qrjzgn?file=index.ts
Api: https://ej2.syncfusion.com/documentation/api/schedule#eventclick
https://ej2.syncfusion.com/documentation/api/schedule#select
[index.ts]
|
let data = [ { Id: 1, Subject: 'Meeting', StartTime: new Date(2018, 1, 15, 10, 0), EndTime: new Date(2018, 1, 15, 11, 0), IsAllDay: false, }, { Id: 2, Subject: 'Lead Time of Meeting', StartTime: new Date(2018, 1, 15, 9, 45), EndTime: new Date(2018, 1, 15, 10, 0), IsAllDay: false, LeadId: 1, CategoryColor: 'pink', }, ]; let scheduleObj: Schedule = new Schedule({ eventClick: (args: any) => { if ((args.event as any).LeadId) { args.cancel = true; } }, select: (args: SelectEventArgs) => { if ((args.data as any).Id && isNullOrUndefined((args.data as any).LeadId)) { let schedule = (document.querySelector('.e-schedule') as any) .ej2_instances[0]; let datas = schedule.eventsData.filter( (item: any) => item.LeadId == (args.data as any).Id ); let id = datas[0].Id; document.querySelector(`[data-id="Appointment_${id}"]` as any).dispatchEvent(new MouseEvent('click', { ctrlKey: true })); } }, allowMultiDrag: true, }); |
Regards,
Swathi Ravi
- 3 Replies
- 2 Participants
-
JO Jon
- May 9, 2023 02:29 AM UTC
- May 16, 2023 02:51 PM UTC