We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

OnResizeStop and OnDragStop not working correctly

With a schedule control in ASP MVC, the OnResizeStop event does not return the correct arguments.

For example:
For a given appointment with StartTime=s to EndTime=e1.
When resized so that EndTime is now equal to  e2 the args.appointment passed to OnResizeStop shows EndTime=e1.
Now when resized so that EndTime is now equal to e3 args.appointment passed to OnResizeStop shows EndTime=e2.
It seems that the args.appointment is returning the appointment object before the resize operation not after it.

The same behavior occurs with the OnDragStop event.

What would be the right procedure to get the exact StartTime and EndTime of an appointment after resize?

Thank you.

5 Replies

SK Sarath Kumar P K Syncfusion Team January 14, 2015 12:16 PM UTC

Hi Ralph,

Thanks for using Syncfusion products.

We regret for the inconvenience caused, as we are able to reproduce the reported issue. Therefore, we suggest you to use the actionComplete event to get the updated start/end time, instead of using the resizeStop and dragStop events. Refer the below code snippet to get the updated time in the actionComplete event.

<code>

@(Html.EJ().Schedule("Schedule1")

        .Width("100%")

        .Height("525px")

        .EnableRTL(false)

        .AllowKeyboardNavigation(false)

        .TimeMode(Syncfusion.JavaScript.TimeMode.Hour12)

        .CurrentDate(new DateTime(2014,6,2))

              .ScheduleClientSideEvents(evt =>

                  evt.ActionComplete("onActionComplete")

                  .ResizeStop("onResizeStop")

                  .DragStop("onDragStop"))

        .AppointmentSettings(fields => fields.Datasource(Model)

            .Id("Id")

            .Subject("Subject")

            .StartTime("StartTime")

            .EndTime("EndTime")

            .AllDay("AllDay")

            .Recurrence("Recurrence")

            .RecurrenceRule("RecurrenceRule"))

            )

 

<script>

    function onActionComplete(args) {

        if (args.requestType == "appointmentResize" || args.requestType == "appointmentDrag")

        {

            var appointment = (args.requestType == "appointmentResize") ? args.data[0] : args.appointment[0];

            alert("Subject: " + appointment.Subject + "\nStartTime: " + appointment.StartTime + "\nEndTime: " + appointment.EndTime);

        }

    }

</code>

And for your reference we have prepared the sample, which can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/directtrac/general/ScheduleSample10700227.zip

Kindly refer the sample and let us know if you need any further assistance on this.

Regards,

Sarath Kumar P K




RM Ralph Mounzer January 14, 2015 08:04 PM UTC

Thank you Sarath,
It works now.
But then the issue becomes that setting the args.cancel to true does not reverse the resize action.
After the user resizes, I post the changes to the server. If for some reason the post fails then I need to cancel the resize.
Any workarounds for this?
Ralph


VS Velmurugan S Syncfusion Team January 19, 2015 12:38 PM UTC

Hi Ralph,

Thanks for your update.

We regret for the inconvenience caused, as we are able to reproduce the reported issue. We have already logged a defect report for this and therefore, the fix for this issue will be included in our next Main release Volume-1, 2015.

We appreciate your patience until then.

Regards,

Velmurugan




RM Ralph Mounzer January 26, 2015 10:19 PM UTC

Thank you for your reply.
When is  Volume-1, 2015 scheduled for release?



VS Velmurugan S Syncfusion Team January 27, 2015 06:25 AM UTC

Hi Ralph,

We have planned to release our next Volume 1, 2015 Essential Studio release at the end of the month March.

Please let us know if you need any further assistance on this.

Regards,

Velmurugan



Loader.
Live Chat Icon For mobile
Up arrow icon