|
|
|
@ -10,6 +10,7 @@ gantt.attachEvent("onAfterTaskAdd", function (id, item) {
|
|
|
|
|
gantt.updateTask(parentId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
updateRange(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
gantt.attachEvent("onTaskRowClick", function (id, row) { |
|
|
|
@ -40,7 +41,16 @@ gantt.ext.inlineEditors.attachEvent("onBeforeEditStart", function (state) {
|
|
|
|
|
} |
|
|
|
|
return true |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function updateRange(){ |
|
|
|
|
var range = gantt.getSubtaskDates(); |
|
|
|
|
var chart = gantt.getState(); |
|
|
|
|
if(range.start_date.valueOf() <= chart.min_date.valueOf() || range.end_date.valueOf() >= chart.max_date.valueOf()){ |
|
|
|
|
gantt.config.start_date = gantt.date.add(range.start_date, -1, "day"); |
|
|
|
|
gantt.config.end_date = gantt.date.add(range.end_date, 2, "day"); |
|
|
|
|
gantt.render(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
gantt.attachEvent("onAfterTaskUpdate", updateRange); |
|
|
|
|
gantt.attachEvent("onBeforeTaskUpdate", function (id, new_item) { |
|
|
|
|
// format progress
|
|
|
|
|
let progress = new_item.progress; |
|
|
|
@ -183,4 +193,4 @@ gantt.attachEvent("onGanttScroll", function (left, top){
|
|
|
|
|
},20) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|