Hi there,
I am trying to do something with the scheduler that I'm not sure is possible. Essentially, I want to allow users to "swap" two items - so if they drag an appointment over another appointment which is exactly the same duration, I would like the two appointments to swap positions.
I have got the javascript going well enough to capture the onAppointmentMoving event to test to see if the appointment is being dragged onto another appointment, and have got logic to determine if the underlying appointment is of the same duration. However, it's the last step that is causing me problems.
Once the user has held the moving appointment over an appointment of the same size for 2 seconds, I would like the underlying appointment to take up the position previously held by the other appointment. Again, I've got the timeout bit working, but I don't want to post back to the server yet, I just want to the appointment to "tentatively" move - if the user were to press escape, or to move the moving appointment over another appointment, the previous one should revert to where it was, and the OTHER appointment be the one that was swapped. Only when the user releases the mouse button do I want a postback to occur.
I have fiddled around in the client-side api for a bit and found a couple of promising functions: repaint and updateAppointment. However, repaint doesn't seem to actually repaint, and updateAppointment causes a postback.
Is there a way to do what I am after? If not via natively implemented functions on the scheduler, could you point me in the right direction for actually manipulating the underlying HTML to do what I'm after? I guess the appointments render as divs, so I figure I could probably get the left and top positions of those items, and reset them accordingly? Can you point me in the right direction regarding which Ids I would need to grab hold of or how to get a reference to the containing divs?
Thanks very much for your help.
Matthew
I am trying to do something with the scheduler that I'm not sure is possible. Essentially, I want to allow users to "swap" two items - so if they drag an appointment over another appointment which is exactly the same duration, I would like the two appointments to swap positions.
I have got the javascript going well enough to capture the onAppointmentMoving event to test to see if the appointment is being dragged onto another appointment, and have got logic to determine if the underlying appointment is of the same duration. However, it's the last step that is causing me problems.
Once the user has held the moving appointment over an appointment of the same size for 2 seconds, I would like the underlying appointment to take up the position previously held by the other appointment. Again, I've got the timeout bit working, but I don't want to post back to the server yet, I just want to the appointment to "tentatively" move - if the user were to press escape, or to move the moving appointment over another appointment, the previous one should revert to where it was, and the OTHER appointment be the one that was swapped. Only when the user releases the mouse button do I want a postback to occur.
I have fiddled around in the client-side api for a bit and found a couple of promising functions: repaint and updateAppointment. However, repaint doesn't seem to actually repaint, and updateAppointment causes a postback.
Is there a way to do what I am after? If not via natively implemented functions on the scheduler, could you point me in the right direction for actually manipulating the underlying HTML to do what I'm after? I guess the appointments render as divs, so I figure I could probably get the left and top positions of those items, and reset them accordingly? Can you point me in the right direction regarding which Ids I would need to grab hold of or how to get a reference to the containing divs?
Thanks very much for your help.
Matthew