This is a migrated thread and some comments may be shown as answers.

Issues with the slotByPosition method during group mode

1 Answer 183 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
jon
Top achievements
Rank 1
jon asked on 12 Aug 2014, 11:25 PM
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();
       }
    }
});}

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 Aug 2014, 06:41 AM
Hello Jon,

We will need a reproduction of this issue in order to troubleshoot it. Could you please create a live demo using the Kendo UI Dojo?

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
jon
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or