danheron / Heron.MudCalendar

Calendar component for MudBlazor
MIT License
149 stars 30 forks source link

ItemChange Validation (Enhancement request) #137

Open JaronrH opened 2 months ago

JaronrH commented 2 months ago

I was wondering if you would consider extending the API to include a validation call for (1) approving an event change and (2) selectively controlling what events can be moved [via drag & drop]. Two example cases would be: 1) I would like to keep a user from dragging a future appointment to the past! 2) I would like to make some appointments unmovable while let other remain editable. This would be in cases where viewing the calendars for a team and the current user is only allowed to control their own events and not the events of the other teammembers.

I think you could accomplish both using a parameter such as Func<CalendarItemChangeRequest, Task> where the CalendarItemChangeRequest contains the current CalendarItem and the proposed changes (new Start, End, AllDay). This call would then return true or false based on if the requested transition should be allowed or not.

Thanks for your consideration!