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

Not showing changed Subject in TimeLineView

1 Answer 61 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kushil
Top achievements
Rank 1
Kushil asked on 23 Jun 2011, 03:40 PM
I am using radScheduler in a typical web form page with server side binding to a generic list. I use timeline view only.
In client side's "OnClientAppointmentResizeEnd" javascript event I need to change the subject of the appointment to the new duration. It will help the user to clearly see the change she did.
I am using the following code.
function OnClientAppointmentResizeEnd(sender, args) {
    var start = args.get_appointment().get_start();
    var end = args.get_targetSlot().get_endTime();
    var appDuration = Math.ceil((end.getTime() - start.getTime()) / (60000)); // show in minutes                       
    appointment.set_subject(appDuration);
    //alert(appDuration);
}
The above works well with web service binding and the user can see the subject of the appoinment changes to the new duration as she resizes the appointment. But this does not work (appointment subject change is not visible) with server side binding.
Any ideas apart from using AppointmentUpdate server side event?
Thanks and regards
Kushil

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 27 Jun 2011, 02:54 PM
Hi Kushil,

After OnClientAppointmentResizeEnd, a postback occurs to update the appointment, so you cannot use the client API in this case. If you handle OnClientAppointmentClick, there is no postback in this case so you could do the following:

Copy Code
function OnClientAppointmentClick(sender, args) {
var appointment = args.get_appointment();
appointment.set_subject("test");
sender.updateAppointment(appointment, false);
}

Note that you need to use the updateAppointment() method to permanently persist the changes.

I am not sure why you don't want to hadle the server-side AppointmentUpdate, but you can still consider it:
Copy Code
protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
if (e.Appointment.End != e.ModifiedAppointment.End)
{
e.ModifiedAppointment.Subject = e.ModifiedAppointment.Duration.TotalMinutes.ToString();
}
}

Please, explain if there are any reasons why you cannot use this approach.




Kind regards,
Peter
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Scheduler
Asked by
Kushil
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or