How to disable drag and drop option for gantt chart

4 posts, 0 answers
  1. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 27 Apr Link to this post

    Hi..

    I'm using kendo gantt chart in my project using anular js,how can i disable drag and drop option

    here is the my code 

    view : 
                <div id="activityganttchart" kendo-gantt k-options="createScheduleStep2.ganttOptions" class="row"
                     k-rebind="createScheduleStep2.ganttOptions"></div>

    controller:

                    productionScheduleStep2Vm.ganttOptions = getActivitiesToDisplayOnGanttChart(activities);
                    productionScheduleStep2Vm.ganttOptions.edit = edit;
                    productionScheduleStep2Vm.ganttOptions.moveStart = ganttMove;

               function processActivitiesToDisplayGanttChart(data: any) {
                    var activityList = new Array();
                    for (var i = 0; i < data.length; i++) {
                        var uomName = "";
                        if (data[i].pitOutputActivity.activityValueUOMId && data[i].pitOutputActivity.activityValueUOM !== undefined) {
                            uomName = data[i].pitOutputActivity.activityValueUOM.name;
                        }
                        var activity = {
                            ID: data[i].pitOutputActivity.id,
                            Title: data[i].pitOutputActivity.activity.name,
                            Start: '\/Date(' + (+new Date(data[i].pitOutputActivity.startDate + " " + data[i].pitOutputActivity.startTime)) + ')\/',
                            End: '\/Date(' + (+new Date(data[i].pitOutputActivity.endDate + " " + data[i].pitOutputActivity.endTime)) + ')\/',
                            target: data[i].pitOutputActivity.activityValue + " " + uomName,
                            activityId: data[i].pitOutputActivity.activityId,
                            shift: data[i].pitOutputActivity.pitOutputActivityPartA.shift,
                            pitOutputActivityUUID: data[i].pitOutputActivity.pitOutputActivityUUID,
                            percentComplete: data[i].progress === "NaN" ? 0 : data[i].progress,
                            planned: data[i].planned,
                            actual: data[i].actual,
                            variance: data[i].variance,
                            assetCount: data[i].assetCount
                        }
                        activityList.push(activity);
                    }
                    return activityList;
                };


                function edit(e) {
                    productionScheduleStep2Vm.selectedActivity = e.task;
                    win = $("<div class='ganntPopup' />").kendoWindow({
                        title: "Manage Activity",
                        resizable: false,
                        modal: true,
                        pinned: true,
                        position: { top: 100 }
                    });
                    e.preventDefault();
                    var template = createScheduleStep2Helpers.compileAngularContent($("#activityMenu").html(), $scope, $compile);
                    win.data("kendoWindow").content(template).center().open();
                };

                function ganttMove(e) {
                    console.log(kendo.format("task's curren Start {0:g}", e.start));
                    console.log(kendo.format("task's curren End {0:g}", e.end));
                    e.preventDefault();
                };

     

    i tried with moveStart  event still im able to dran and drop

    Appreciate your support!
    Thanks!

     

  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 28 Apr Link to this post

    Hi,

    Here is a dojo snippet showing how to disable the drag to reorder functionality of the Gantt widget.

    Regards,
    Dimitar Terziev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 28 Apr in reply to Dimitar Terziev Link to this post

    Hi..

    Thanks for u r reply,

    i'm able to drag and drop the tasks in provided example, i wanted to disable drag and drop completely

     

  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 28 Apr Link to this post

    Hi,

    The provided sample disables the action executed after the drop. Currently, there is no available API to disable the drag functionality.

    Regards,
    Dimitar Terziev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready