How to restrict the drag and drop action for specific tasks in resource view Gantt
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.