Scheduler - Edit custom appointements single and recurring

1 Answer 41 Views
Scheduler
Emmanuel
Top achievements
Rank 1
Emmanuel asked on 21 Oct 2024, 10:04 AM

Hello,
I am using the Scheduler, and I need to go quite far in its usage.

The events I need to display in the Scheduler follow creation constraints that require me to have control over the creation form.

So, I naturally followed the guide to create a 'custom edit form' found here: https://github.com/telerik/blazor-ui/tree/master/scheduler/custom-edit-form. However, I am facing an issue where I am unable to retrieve the user's choice from the popup. (cf 2024-10-21-11h47_41.png)"

I implemented the JS hack on the double-click:

function clickSchedulerPromptButton(btnIndex) {
    setTimeout(function () {
        var buttons = document.querySelectorAll(".k-window-content .text-right button");
        if (buttons && buttons.length >= btnIndex) {
            var chosenButton = buttons[btnIndex];
            chosenButton.click();
        }
    }, 50);
}

This allows me to handle the choice in my own edit popup (which, by the way, reduces the number of windows opened, improving the user experience), and it works.

However, if the Scheduler is configured with AllowUpdate = true, another way to modify a series becomes available: resizing appointments with the mouse. In this specific case, the EditItem event is not triggered; instead, the OnUpdate event is triggered, but only after the choice popup has been displayed. Since it's not possible to retrieve the user's choice, the entire series is always modified (and the event arguments do not carry the targeted occurrence date anyway).

I believe this is a BUG, as it makes the Scheduler difficult to use in its current state.

Can you help me to solve this bug :

  • Trigger the EditItem event, even during a drag-and-drop of an appointment.
  • Add the user's choice information in the arguments of SchedulerUpdateEventArgs and SchedulerEditEventArgs.
  • Avoid displaying this choice popup (which is unnecessary); it should be integrated into the appointment form.
  • Include information related to the targeted occurrence in the event arguments (currently, only SchedulerEditEventArgs provides this detail)."

Thank you in advance for your response, which I hope will be constructive.

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Nadezhda Tacheva
Telerik team
answered on 24 Oct 2024, 08:32 AM

Hi Emmanuel,

Please see my comments on your questions as follows:

> Trigger the EditItem event, even during a drag-and-drop of an appointment.

By design, the OnEdit event does not fire when the user drags to resize or move appointments, it fires only for the advanced edit form (double clicks on the appointment or slot).

> Add the user's choice information in the arguments of SchedulerUpdateEventArgs and SchedulerEditEventArgs.

Indeed, it will be useful to provide a way to get the user choice from the "Edit Recurring Appointment" dialog. This feature request will track the implementations of this functionality: Differentiate "edit current occurrence" and "edit the series" in the RecurrenceDialog. I see you already voted for it. In addition, you may follow it to get timely status updates.

> Avoid displaying this choice popup (which is unnecessary); it should be integrated into the appointment form.

This is currently not possible but we also have a request to allow disabling the dialog: Ability to directly edit an occurence or the series, without the prompt asking you to choose.

In the meantime, you may try the workaround listed in the "Admin edit" section. It shows how to programmatically click one of the buttons, so the form will open. You may then include edit the occurrence/series option in the form.

> Include information related to the targeted occurrence in the event arguments (currently, only SchedulerEditEventArgs provides this detail)."

I may be missing something in your question here but generally, the Update event arguments also provide details for the occurrence - you get the Id and also the RecurrenceId:

 

The most common scenario to get the user choice from the  "Edit Recurring Appointment" dialog is to use that information when rendering the custom edit form. However, when resizing or moving an appointment, the Scheduler is aware of the user choice and in the OnUpdate handler it will provide the corresponding item - occurrence or series.

Based on the testing I performed when resizing or moving an appointment, the change is applied based on my choice - the entire series is not always modified. I wonder what causes the different behavior on your end. To investigate further you may send an isolated runnable sample that showcases the exact behavior you are hitting.

Regards,
Nadezhda Tacheva
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Scheduler
Asked by
Emmanuel
Top achievements
Rank 1
Answers by
Nadezhda Tacheva
Telerik team
Share this question
or