Scheduler firing twice

2 posts, 0 answers
  1. Martin
    Martin avatar
    15 posts
    Member since:
    Sep 2013

    Posted 27 Nov 2013 Link to this post

    When I have the data source CRUD set in the Razor version of the Scheduler control AND I define events for Save and Remove the call to the Read and Destroy calls are duplicated.

    Is this the correct behavior?

    01.<input type="hidden" id="scheduleID" required data-required-msg="Please select a schedule."/>
    02. 
    03.@(Html.Kendo().Scheduler<DOTTReportsWebViewer.Models.TaskViewModel>()
    04.    .Name("scheduler")
    05.    .Editable(e=>e
    06.                .Confirmation(false)
    07.                .Update(false)
    08.                .Resize(false)
    09.     )
    10.    .Date(DateTime.Now)
    11.    .StartTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00))
    12.    .Views(views =>
    13.    {
    14.        views.DayView();
    15.        views.WeekView(weekView => weekView.Selected(true));
    16.        views.MonthView();
    17.        views.AgendaView();
    18.    })
    19.    .Timezone("Etc/UTC")
    20.    .DataSource(d => d
    21.        .Model(m => {
    22.            m.Id(f => f.TaskID);
    23.            m.Field(f => f.OwnerID).DefaultValue(1);
    24.        })
    25.         
    26.        .Read("Tasks_Read", "Subscriptions")
    27.        .Create("Tasks_Create", "Subscriptions")
    28.        .Destroy("Tasks_Destroy", "Subscriptions")
    29.        .Update("Tasks_Update", "Subscriptions")
    30.         
    31.    )
    32.    .Events(events => events
    33.            .Save("scheduler_save")
    34.            .Remove("scheduler_remove")
    35.            )
    36.     
    37.     
    38.)
    39.     
    40. 
    41.<script type="text/javascript">
    42.    
    43.    function scheduler_save(e) {
    44.        
    45.        var scheduler = $("#scheduler").data("kendoScheduler");
    46.         
    47.        if ($("#scheduleID").val() != '') {
    48.            scheduler.removeEvent($("#scheduleID").val());
    49.        }
    50.        $("#scheduleID").val(e.event.uid);
    51.    }
    52.     
    53.    function scheduler_remove(e) {
    54.        $("#scheduleID").val('');
    55.         
    56.    }
    57. 
    58.</script>

  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 28 Nov 2013 Link to this post

    Hi Martin,

    Unfortunately, I'm not able to observe such behavior locally using the provided information. Therefore, could you please provide a small runnable sample in which this issue can be recreated locally.

    Regards,
    Rosen
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top