BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
Is it possible to prevent the user dragging an event to a resource if that resource already has an event for any part of the time of that event?
So given this situation we should not be able to move the event (2 Guests Jim) to the resource (for the times shown) that already has an event (2 Guests Bob).
Thanks,
Alex
Hi Alex,
You can prevent the appointments from being added on the resource has same date range by using the IsSlotAvailable method in the OnActionBegin, as shown in the below snippet.
[index.razor]
<SfSchedule @ref="ScheduleRef" TValue="AppointmentData" Height="550px" @bind-SelectedDate="@CurrentDate"> <ScheduleEvents TValue="AppointmentData" OnActionBegin="OnActionBegin"></ScheduleEvents> </SfSchedule> public async Task OnActionBegin(ActionEventArgs<AppointmentData> args) { bool availability = true; if (args.ActionType == ActionType.EventChange) { var records = args.AddedRecords ?? args.ChangedRecords; if (records == null) { return; } availability = await ScheduleRef.IsSlotAvailableAsync(records.First()); } args.Cancel = !availability; } |
Regards,
Swathi Ravi
Thanks will take a look
Alex,
You are welcome. Let us know if you need any further assistance on this.