0
votes

I have set up this js fiddle so that you cannot update an element in the scheduler if it conflicts with an existing elements time slot (1:1 as element:timeslot)

How could I extend this functionality so you cannot drag an element from the grid into an unavailable timeslot in the scheduler? Currently it will stack elements horizontally.

jsfiddle

1
i tried your jsfiddle it's still can drag element to a scheduler slot which have an event on it which is not (1:1 as element:timeslot) furthermore you don't use your timeSlotOccupied function, second you said "unavailable timeslot" is it the greyed out slot the k-non-workhour? - himawan_r
The collision detection only works for elements already in the scheduler. I was trying to get that to work for elements that are dropped in from an external list too - ds011591
Please edit the externally hosted code into the post; doing so will make sure it remains useful even if the link breaks. My script is not allowed to do this because of potential licensing problems. - Glorfindel

1 Answers

1
votes

How could I extend this functionality so you cannot drag an element from the grid into an unavailable timeslot in the scheduler

Unavailable timeslot could mean anything, depend on your situation but generally if i'm not mistaken it would mean the greyed out slot which have the k-nonwork-hour class. Simply add your if condition with

if (!$(e.dropTarget).hasClass("k-nonwork-hour") && !timeSlotOccupied(slot.startDate,slot.endDate,dataItem)  && dataItem && slot) 

DEMO