Issues with the slotByPosition method during group mode

2 posts, 0 answers
  1. jon
    jon avatar
    9 posts
    Member since:
    Jun 2010

    Posted 12 Aug 2014 Link to this post

    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();
           }
        }
    });}
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 15 Aug 2014 Link to this post

    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!
     
Back to Top