|
@(Html.EJ().Gantt("Gantt")
//...
.ClientSideEvents(cl => {
cl.ActionBegin("ActionBegin");
})
)
<script>
function ActionBegin(args) {
if (args.requestType == "validateLinkedTask") {
args.validateMode.preserveLinkWithEditing = false;
}
}
</script> |
|
[CSHTML]
function ActionComplete(args) {
//To update on indent,outdent, taskbar editing and predecessor drawn action
if (args.requestType == "indent" || args.requestType == "outdent" || args.requestType == "recordUpdate" || (args.requestType === 'save' && args.modifiedRecord) || args.requestType == "drawConnectorLine") {
var ganttRec = [];
// Dialog Editing
if (args.requestType == "save")
ganttRec.push(args.modifiedRecord);
else if (args.requestType == "drawConnectorLine")
ganttRec.push(args.currentRecord);
else
ganttRec.push(args.data); // Cell Editing
if (args.updatedRecords && args.updatedRecords.length)
ganttRec = ganttRec.concat(args.updatedRecords);
updateModifiedGanttRecords(ganttRec);
}
//..
} |
Hello, Suriyaprasanth
Thanks the Link about predecessor explained so clearly I ignored my fault, but there still some issues be found when I try it.
If I drag subtask's start date before the parent's end date with FS relationship, no matter how I choose the subtask's date has been changed.
The chooses of "closebutton", "cancelbutton", and "OK button with select 'Cancel, Keep the existing link' " will have the same result in the Validate Editing dialog.
The task's date will not cancel this operation, it will keep the existing link but just put the date at the parent behind in order to keep the changed task date, so in fact the changed task date will not be cancel.
And I found if click the "closebutton" in the Validate Editing dialog, the updateModifiedGanttRecords function is called many times, depending on the Gantt UI be edited times.
For the Query2, I found even I choice: "Move the task start date to edited date and keep the link." The Predecessors of Task Information dialog about Offset still "0 days", not be updated.
Thank you,
Best regards