This is a migrated thread and some comments may be shown as answers.

Scheduler firing twice

1 Answer 100 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 27 Nov 2013, 03:58 PM

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>

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 28 Nov 2013, 08:05 AM
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!
Tags
Scheduler
Asked by
Martin
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or