Hi,
I'm using version 2009.2.1007.35 of the radcontrols at the moment. I have a RadScheduler component in my page.
Moving an appointment results in a piece of javascript running, which uses a call to a webmethod to see if the appointment can be moved. Because I don't want the appointment to "jump around on the screen", I don't cancel the event.
When the call to the webmethod returns, it might return a value indicating that the move was invalid or not allowed. In that case, I have to move the appointment back to its original time (begin and end), but also to its original resource.
To do this I have this piece of code:
But now the problem:
When this code has run, the resource in the scheduler itself is also overwritten. I will try to explain this: Say I move an appointment from resource 1 to 2, but it is invalid, so I move it back to 1 using the code as above. Afterwards, everything I move to 2 will have e.get_targetSlot().get_resource().get_key() = 1 in a handler for the OnClientAppointmentMoveEnd event, while that should be 2. So it seems the set_key and set_text on the resource of the appointment has also overwritten the resource of the scheduler itself.
This might be intended (probable the resources of the appointment ARE the resources known in the Scheduler), so I'm not sure if this is a bug. But in any case, I'm looking for a way to move an appointment from one resource to another in clientside javascript, without messing things up
Any help would be greatly appreciated!
I'm using version 2009.2.1007.35 of the radcontrols at the moment. I have a RadScheduler component in my page.
Moving an appointment results in a piece of javascript running, which uses a call to a webmethod to see if the appointment can be moved. Because I don't want the appointment to "jump around on the screen", I don't cancel the event.
When the call to the webmethod returns, it might return a value indicating that the move was invalid or not allowed. In that case, I have to move the appointment back to its original time (begin and end), but also to its original resource.
To do this I have this piece of code:
var curResource = telerikAppointment.get_resources().getResourceByType("Employee"); |
curResource.set_key(oldEmployeeID); |
curResource.set_text(oldEmployeeName); |
telerikAppointment.set_start(oldStartTime); |
telerikAppointment.set_end(oldEndTime); |
radScheduler.updateAppointment(globalData.telerikAppointment, false); |
But now the problem:
When this code has run, the resource in the scheduler itself is also overwritten. I will try to explain this: Say I move an appointment from resource 1 to 2, but it is invalid, so I move it back to 1 using the code as above. Afterwards, everything I move to 2 will have e.get_targetSlot().get_resource().get_key() = 1 in a handler for the OnClientAppointmentMoveEnd event, while that should be 2. So it seems the set_key and set_text on the resource of the appointment has also overwritten the resource of the scheduler itself.
This might be intended (probable the resources of the appointment ARE the resources known in the Scheduler), so I'm not sure if this is a bug. But in any case, I'm looking for a way to move an appointment from one resource to another in clientside javascript, without messing things up
Any help would be greatly appreciated!