Approved
Last Updated: 20 Mar 2019 15:21 by ADMIN
Andy
Created on: 19 Mar 2019 10:57
Category: Scheduler
Type: Bug Report
0
Appointment click event is fired when resizing in Chrome
Using the following setup, resize the appointment so that when releasing the mouse, it is over the appointment as demonstrated in the attached video with the attached project.

<telerik:RadScheduler RenderMode="Lightweight" Font-Size="14px" runat="server" ID="RadScheduler1"
      SelectedDate="2012-04-16"
      OnClientAppointmentClick="OnClientAppointmentClick"
      OnClientAppointmentResizeEnd="OnClientAppointmentResizeEnd">
  </telerik:RadScheduler>

<script>
    function OnClientAppointmentResizeEnd(sender, args) {
    }
 
    function OnClientAppointmentClick(sender, args) {
        alert("OnClientAppointmentClick")
    }
</script>

private const string ProviderSessionKey = "Telerik.Web.Examples.Scheduler.XmlSchedulerProvider.DefaultCS";
 
    // You can safely ignore this method.
    // Its purpose is to limit the changes to the underlying data only to the active user session.
    protected void Page_Init(object sender, EventArgs e)
    {
        Telerik.Web.UI.XmlSchedulerProvider provider;
        if ((Session[ProviderSessionKey] == null) || (!IsPostBack))
        {
            provider = new Telerik.Web.UI.XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), true);
            Session[ProviderSessionKey] = provider;
        }
        else
        {
            provider = (Telerik.Web.UI.XmlSchedulerProvider)Session[ProviderSessionKey];
        }
 
        RadScheduler1.Provider = provider;
    }

1 comment
ADMIN
Peter Milchev
Posted on: 19 Mar 2019 13:05
Hi Andy,

This can be fixed easily by using the OnClientAppointmentResizeStart and OnClientAppointmentResizeEnd: 

<script>
    function OnClientAppointmentResizeStart(sender, args) {
        sender.__resizing = true;
    }
    function OnClientAppointmentResizeEnd(sender, args) {
        sender.__resizing = true;
        sender.clearResizing = setTimeout(function () {
            sender.__resizing = false;
        }, 10);
    }
 
    function OnClientAppointmentClick(sender, args) {
        if (sender.__resizing) {
            sender.__resizing = false;
            return;
        }
        alert("OnClientAppointmentClick");
    }
</script>

Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.