Articles in this section
Category / Section

How to restrict the drag and drop action for specific tasks in resource view Gantt

1 min read

In the Resourceview Gantt, it is possible to restrict the drag and drop action for the specific tasks by using the taskbarEditing client-side event. The taskbarEditing event will be triggered when dragging and resizing the taskbar in the Gantt chart. Please refer the following code example for this.

<script type="text/javascript">
$(function () {
         $("#resourceGantt").ejGantt({
                dataSource: resourceGanttData,
                taskIdMapping: "taskID",
                taskNameMapping: "taskName",
                taskbarEditing: function (args) {
                   if (args.rowData.item.taskID == 1 || args.rowData.item.taskID==4)
                        args.cancel = true;
                },
                //..
        });
  });
</script>
 

Sample:

A sample to restrict the drag and drop action for the specific tasks in the  ResourceView Gantt is available here.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied