I have implemented drag and drop onto a scheduler widget using sample code from Telerik. The scheduler "Drop Target Area" works fine when the scheduler IS NOT being grouped. However in grouped mode, the method "slotByPosition(left, right)" is always returning null.
function
createDropArea(scheduler) {
scheduler.view().content.kendoDropTargetArea({
filter:
".k-scheduler-table td, .k-event"
,
drop:
function
(e) {
var
grid = $(
"#grid"
).data(
"kendoGrid"
);
var
sch = $(
"#"
+ scheduler.element[0].id).data(
"kendoScheduler"
);
var
offset = $(e.dropTarget).offset();
var
slot = sch.slotByPosition(offset.left, offset.top);
var
dataItem = grid.dataItem(grid.select());
if
(dataItem && slot) {
var
offsetMiliseconds =
new
Date().getTimezoneOffset() * 60000;
var
newEvent = {
title: dataItem.Name,
end:
new
Date(moment(slot.endDate).add(
'minutes'
, 30)),
start: slot.startDate,
isAllDay: slot.isDaySlot,
jobId: dataItem.Id,
};
scheduler.dataSource.add(newEvent);
scheduler.dataSource.sync();
}
}
});}