search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Disallowing the user to drag/drop/resize appointments to nonbusiness days

Asked by Jay
12 years ago.

Hello Dan,

I'm trying to figure out how tograb the events that fire when the user drags/drops or resizes an appointment time. I need to know the new date and time range the user drag/drop or resized to so that if it is a nonbusiness time, I will give a javascript warning telling them they cannot drag/resize to the new date. Is there a way to do this?I emailed you this question also. Thanks!

Comment posted by Dan Letecky
12 years ago.
You should switch the handling to JavaScript (EventMoveHandling="JavaScript"). In the event handler specified in EventMoveJavaScript you will get the new start and end as newStart and newEnd variables (all times in GMT, be careful here).

You should check the day using newStart.getDay(), for example. If the conditions are OK, you can invoke the original handler using dpc1.eventMoveCallBack(e, newStart, newEnd, oldColumn, newColumn). All these variables (e, newStart....) are available to the script specified in EventMoveJavaScript. "dpc1" is the value of ClientObjectName property.

Let me know if this doesn't work.
Comment posted by Jay
12 years ago.

Hi Dan,

Is there a way to get the cell background colors that were selected in the move/resize? We're trying to verify whether the date is non-business based on the cell colors. This way, we don't have to make an additional trip to the db (the algorithm for calculating nonbusiness dates is pretty large, and can cause significant burden on the server).

If there is no way to get the cell colors, we will have to implement it in the way you mentioned, although that would be less desirable.

Comment posted by Dan Letecky
12 years ago.
I would like to extend it so you will have IsBusiness information available but at this moment it's not possible.
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.