John Leidegren
Top achievements
Rank 1
John Leidegren
asked on 26 Nov 2009, 10:02 AM
can some on fix the spelling mistake in the topic "preserve"
When i drag'n'drop appointments in the MonthView the date and duration is correct but the start time is set to mid-night. What am I doing wrong?
When i drag'n'drop appointments in the MonthView the date and duration is correct but the start time is set to mid-night. What am I doing wrong?
| protected void AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e) |
| { |
| // The problem is here: |
| e.Appointment.Start; // 08:00 |
| e.Appointment.End; // 10:00 |
| e.ModifiedAppointment.Start; // 00:00 (the date has changed but the time is wrong) |
| e.ModifiedAppointment.End; // 02:00 |
| } |
5 Answers, 1 is accepted
0
Hi John,
We tested the scenario but there was no such problem at our end. Are there any special details around your implementation that we should be aware of?
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
We tested the scenario but there was no such problem at our end. Are there any special details around your implementation that we should be aware of?
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Leidegren
Top achievements
Rank 1
answered on 26 Nov 2009, 03:02 PM
My mistake,
I have a jQuery UI dialog in where I do this (see JavaScript below), within the context of a OnClientAppointmentMoveEnd event (I've included the entire script). I had to do this in order to be able to provide my own dialog for asking the user whether to move, copy or cancel the action. It would be great if the RadScheduler implemented a mechanism for this as well, because right now. After the drag and drop is complete, the appointment jumps back to it's original position, then, when I press the move or copy button within the dialog the postback happens and the changes appears. It's an ugly way of doing it, but it does get the job done.
| function OnClientAppointmentMoveEnd(sender, e) { |
| var source = e.get_appointment(); |
| var div = $("<div>Vad vill du göra?</div>"); |
| div.appendTo(document.body); |
| div.dialog({ |
| buttons: { |
| "Cancel": function() { |
| $(this).dialog('close'); |
| }, |
| "Move": function() { |
| var a = source; // move |
| var duration = a.get_duration(); |
| // the month view target slot does not have a time component |
| var start; |
| if (sender.get_selectedView() == Telerik.Web.UI.SchedulerViewType.MonthView) |
| start = new Date(e.get_targetSlot().get_startTime().getTime() + (a.get_start().getHours() * 3600 + a.get_start().getMinutes() * 60) * 1000); |
| else |
| start = e.get_targetSlot().get_startTime(); |
| a.set_start(start); |
| a.set_end(new Date(start.getTime() + duration)); |
| sender.updateAppointment(a); |
| $(this).dialog('close'); |
| }, |
| "Copy": function() { |
| var a = $.extend({}, source); // clone |
| var duration = a.get_duration(); |
| var start; |
| if (sender.get_selectedView() == Telerik.Web.UI.SchedulerViewType.MonthView) |
| start = new Date(e.get_targetSlot().get_startTime().getTime() + (a.get_start().getHours() * 3600 + a.get_start().getMinutes() * 60) * 1000); |
| else |
| start = e.get_targetSlot().get_startTime(); |
| a.set_start(start); |
| a.set_end(new Date(start.getTime() + duration)); |
| sender.insertAppointment(a); |
| $(this).dialog('close'); |
| } |
| } |
| }); |
| e.set_cancel(true); |
| } |
When in month view the target slot does not respect time (and that's not entirely strange because in month view the target slot is a specific day) but the function get_newStartTime() probably should, yet, it does not.
I had to make it work like this:
In my opinion the get_newStartTime() should be updated to solve this problem for me.
I had to make it work like this:
| var start; |
| if (sender.get_selectedView() == Telerik.Web.UI.SchedulerViewType.MonthView) |
| start = new Date(e.get_targetSlot().get_startTime().getTime() + (a.get_start().getHours() * 3600 + a.get_start().getMinutes() * 60) * 1000); |
| else |
| start = e.get_targetSlot().get_startTime(); |
In my opinion the get_newStartTime() should be updated to solve this problem for me.
0
Hello John,
I am a bit confused about what exactly you need to achieve. Can you please elaborate on your requirement and provide us with more context of your implementation. For example, which client events of RadScheduler do you handle? Complete code of your RadScheduler implementation would be helpful too.
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I am a bit confused about what exactly you need to achieve. Can you please elaborate on your requirement and provide us with more context of your implementation. For example, which client events of RadScheduler do you handle? Complete code of your RadScheduler implementation would be helpful too.
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Leidegren
Top achievements
Rank 1
answered on 27 Nov 2009, 09:19 AM
I've updated my previous post.
0
Accepted
Hello John,
Thank you for your feedback. We will consider your suggestion.
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thank you for your feedback. We will consider your suggestion.
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.