@syncfusion/ej2-gantt 24.2.7 → 24.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2225,12 +2225,14 @@ class TaskProcessor extends DateProcessor {
2225
2225
  work = parseFloat(work.toFixed(2));
2226
2226
  }
2227
2227
  }
2228
- if (ganttData.childRecords.length > 0 && this.parent.isOnEdit) {
2229
- let childCompletedWorks = 0;
2230
- for (let i = 0; i < ganttData.childRecords.length; i++) {
2231
- childCompletedWorks += ganttData.childRecords[i].ganttProperties.work;
2228
+ if (ganttData.childRecords) {
2229
+ if (ganttData.childRecords.length > 0 && this.parent.isOnEdit) {
2230
+ let childCompletedWorks = 0;
2231
+ for (let i = 0; i < ganttData.childRecords.length; i++) {
2232
+ childCompletedWorks += ganttData.childRecords[i].ganttProperties.work;
2233
+ }
2234
+ work += childCompletedWorks;
2232
2235
  }
2233
- work += childCompletedWorks;
2234
2236
  }
2235
2237
  this.parent.setRecordValue('work', work, ganttData.ganttProperties, true);
2236
2238
  if (!isNullOrUndefined(this.parent.taskFields.work)) {
@@ -2445,7 +2447,7 @@ class TaskProcessor extends DateProcessor {
2445
2447
  this.parent.setRecordValue('work', work, ganttProperties, true);
2446
2448
  switch (tType) {
2447
2449
  case 'FixedDuration':
2448
- this.updateUnitWithWork(ganttData);
2450
+ this.updateWorkWithDuration(ganttData);
2449
2451
  break;
2450
2452
  case 'FixedWork':
2451
2453
  this.updateUnitWithWork(ganttData);
@@ -2860,14 +2862,18 @@ class TaskProcessor extends DateProcessor {
2860
2862
  this.parent.ganttChartModule.scrollObject['isSetScrollLeft'])) && !isFromTimelineVirtulization) {
2861
2863
  isValid = false;
2862
2864
  }
2863
- if (this.parent.enableTimelineVirtualization && isValid && !this.parent.timelineModule['performedTimeSpanAction']) {
2865
+ if (!this.parent.editModule && this.parent.enableTimelineVirtualization && isValid && !this.parent.timelineModule['performedTimeSpanAction']) {
2864
2866
  leftValueForStartDate = (this.parent.enableTimelineVirtualization && this.parent.ganttChartModule.scrollObject.element.scrollLeft != 0)
2865
2867
  ? this.parent.ganttChartModule.scrollObject.getTimelineLeft() : null;
2866
2868
  }
2867
- const timelineStartDate = (this.parent.enableTimelineVirtualization && !isNullOrUndefined(leftValueForStartDate))
2869
+ const timelineStartDate = (!this.parent.editModule && this.parent.enableTimelineVirtualization && !isNullOrUndefined(leftValueForStartDate))
2868
2870
  ? new Date((this.parent.timelineModule['dateByLeftValue'](leftValueForStartDate)).toString()) : new Date(this.parent.timelineModule.timelineStartDate);
2869
2871
  if (timelineStartDate) {
2870
- return (date.getTime() - timelineStartDate.getTime()) / (1000 * 60 * 60 * 24) * this.parent.perDayWidth;
2872
+ let leftValue = (date.getTime() - timelineStartDate.getTime()) / (1000 * 60 * 60 * 24) * this.parent.perDayWidth;
2873
+ if (this.parent.isInDst(timelineStartDate) && !this.parent.isInDst(startDate) && (this.parent.timelineModule.topTier == 'Hour' || this.parent.timelineModule.bottomTier == 'Hour')) {
2874
+ leftValue = leftValue - this.parent.timelineSettings.timelineUnitSize;
2875
+ }
2876
+ return leftValue;
2871
2877
  }
2872
2878
  else {
2873
2879
  return 0;
@@ -6327,10 +6333,8 @@ class Timeline {
6327
6333
  this.parent.dateValidationModule.calculateProjectDates();
6328
6334
  }
6329
6335
  if (!isNullOrUndefined(this.parent.zoomingProjectStartDate)) {
6330
- this.parent.cloneProjectStartDate = this.parent.cloneProjectStartDate.getTime() < this.parent.zoomingProjectStartDate.getTime()
6331
- ? this.parent.cloneProjectStartDate : this.parent.zoomingProjectStartDate;
6332
- this.parent.cloneProjectEndDate = this.parent.cloneProjectEndDate.getTime() > this.parent.zoomingProjectEndDate.getTime()
6333
- ? this.parent.cloneProjectEndDate : this.parent.zoomingProjectEndDate;
6336
+ this.parent.cloneProjectStartDate = this.parent.zoomingProjectStartDate;
6337
+ this.parent.cloneProjectEndDate = this.parent.zoomingProjectEndDate;
6334
6338
  }
6335
6339
  this.parent.zoomingProjectStartDate = null;
6336
6340
  this.parent.zoomingProjectEndDate = null;
@@ -11587,6 +11591,7 @@ class Dependency {
11587
11591
  this.parentIds = [];
11588
11592
  this.parentPredecessors = [];
11589
11593
  this.validatedParentIds = [];
11594
+ this.storeId = null;
11590
11595
  this.parent = gantt;
11591
11596
  this.dateValidateModule = this.parent.dateValidationModule;
11592
11597
  }
@@ -12062,7 +12067,7 @@ class Dependency {
12062
12067
  }
12063
12068
  if (flatData[count].hasChildRecords && this.parent.editModule && !this.parent.allowUnscheduledTasks
12064
12069
  && this.parent.allowParentDependency) {
12065
- this.parent.editModule['updateChildItems'](flatData[count]);
12070
+ this.updateChildItems(flatData[count]);
12066
12071
  }
12067
12072
  }
12068
12073
  }
@@ -12074,7 +12079,7 @@ class Dependency {
12074
12079
  let item = this.parentPredecessors[i];
12075
12080
  this.validatePredecessorDates(item);
12076
12081
  if (item.ganttProperties.startDate) {
12077
- this.parent.editModule['updateChildItems'](item);
12082
+ this.updateChildItems(item);
12078
12083
  }
12079
12084
  }
12080
12085
  }
@@ -12451,7 +12456,15 @@ class Dependency {
12451
12456
  continue;
12452
12457
  }
12453
12458
  if (record) {
12454
- this.validatePredecessor(record, undefined, 'successor');
12459
+ if (this.parent.editModule.isFirstCall) {
12460
+ this.storeId = JSON.parse(JSON.stringify(this.parent.ids));
12461
+ this.parent.editModule.isFirstCall = false;
12462
+ }
12463
+ let index = (this.storeId && this.storeId.indexOf(record[this.parent.taskFields.id].toString()) !== -1) ? this.storeId.indexOf(record[this.parent.taskFields.id].toString()) : -1;
12464
+ if (index !== -1) {
12465
+ this.storeId = this.storeId.slice(0, index).concat(this.storeId.slice(index + 1));
12466
+ this.validatePredecessor(record, undefined, 'successor');
12467
+ }
12455
12468
  }
12456
12469
  }
12457
12470
  if (record && !record.hasChildRecords && record.parentItem && this.validatedParentIds.indexOf(record.parentItem.taskId) == -1) {
@@ -12466,13 +12479,13 @@ class Dependency {
12466
12479
  if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
12467
12480
  if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
12468
12481
  if (!ganttProp.hasChildRecords && record.hasChildRecords) {
12469
- this.parent.editModule['updateChildItems'](record);
12482
+ this.updateChildItems(record);
12470
12483
  this.isValidatedParentTaskID = record.ganttProperties.taskId;
12471
12484
  }
12472
12485
  }
12473
12486
  else if ((!record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
12474
12487
  (record.hasChildRecords && taskBarModule.taskBarEditAction == 'ParentDrag')) {
12475
- this.parent.editModule['updateChildItems'](record);
12488
+ this.updateChildItems(record);
12476
12489
  this.isValidatedParentTaskID = record.ganttProperties.taskId;
12477
12490
  }
12478
12491
  if (!ganttProp.hasChildRecords) {
@@ -12480,11 +12493,128 @@ class Dependency {
12480
12493
  }
12481
12494
  }
12482
12495
  else if (record && record.hasChildRecords && !ganttProp) {
12483
- this.parent.editModule['updateChildItems'](record);
12496
+ this.updateChildItems(record);
12484
12497
  }
12485
12498
  }
12486
12499
  }
12487
12500
  }
12501
+ /**
12502
+ *
12503
+ * @param {IGanttData} ganttRecord .
12504
+ * @returns {void} .
12505
+ */
12506
+ updateChildItems(ganttRecord) {
12507
+ const previousData = this.parent.previousRecords[ganttRecord.uniqueID];
12508
+ let previousStartDate;
12509
+ if (isNullOrUndefined(previousData) ||
12510
+ (isNullOrUndefined(previousData) && !isNullOrUndefined(previousData.ganttProperties))) {
12511
+ previousStartDate = new Date(ganttRecord.ganttProperties.startDate.getTime());
12512
+ }
12513
+ else {
12514
+ if (!isNullOrUndefined(previousData.ganttProperties.startDate)) {
12515
+ previousStartDate = new Date(previousData.ganttProperties.startDate.getTime());
12516
+ }
12517
+ }
12518
+ const currentStartDate = ganttRecord.ganttProperties.startDate;
12519
+ const childRecords = [];
12520
+ let validStartDate;
12521
+ let validEndDate;
12522
+ let calcEndDate;
12523
+ let isRightMove;
12524
+ let durationDiff;
12525
+ this.getUpdatableChildRecords(ganttRecord, childRecords);
12526
+ if (childRecords.length === 0) {
12527
+ return;
12528
+ }
12529
+ if (!isNullOrUndefined(previousStartDate) && !isNullOrUndefined(currentStartDate) && previousStartDate.getTime() > currentStartDate.getTime()) {
12530
+ validStartDate = this.parent.dateValidationModule.checkStartDate(currentStartDate);
12531
+ validEndDate = this.parent.dateValidationModule.checkEndDate(previousStartDate, ganttRecord.ganttProperties);
12532
+ isRightMove = false;
12533
+ }
12534
+ else {
12535
+ validStartDate = this.parent.dateValidationModule.checkStartDate(previousStartDate);
12536
+ validEndDate = this.parent.dateValidationModule.checkEndDate(currentStartDate, ganttRecord.ganttProperties);
12537
+ isRightMove = true;
12538
+ }
12539
+ //Get Duration
12540
+ if (!isNullOrUndefined(validStartDate) && !isNullOrUndefined(validEndDate) && validStartDate.getTime() >= validEndDate.getTime()) {
12541
+ durationDiff = 0;
12542
+ }
12543
+ else {
12544
+ durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
12545
+ }
12546
+ for (let i = 0; i < childRecords.length; i++) {
12547
+ if (childRecords[i].ganttProperties.isAutoSchedule) {
12548
+ if (durationDiff > 0) {
12549
+ const startDate = isScheduledTask(childRecords[i].ganttProperties) ?
12550
+ childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
12551
+ childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.endDate ?
12552
+ childRecords[i].ganttProperties.endDate : new Date(previousStartDate.toString());
12553
+ if (isRightMove) {
12554
+ calcEndDate = this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(startDate, childRecords[i].ganttProperties, childRecords[i].ganttProperties.isMilestone), durationDiff, 'minute', childRecords[i].ganttProperties, false);
12555
+ }
12556
+ else {
12557
+ calcEndDate = this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(startDate, childRecords[i].ganttProperties), durationDiff, 'minute', childRecords[i].ganttProperties);
12558
+ }
12559
+ this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
12560
+ if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
12561
+ this.validatedChildItems.push(childRecords[i]);
12562
+ }
12563
+ }
12564
+ else if (isNullOrUndefined(previousData)) {
12565
+ calcEndDate = previousStartDate;
12566
+ this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
12567
+ if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
12568
+ this.validatedChildItems.push(childRecords[i]);
12569
+ }
12570
+ }
12571
+ }
12572
+ }
12573
+ if (childRecords.length) {
12574
+ this.parent.dataOperation.updateParentItems(ganttRecord, true);
12575
+ }
12576
+ }
12577
+ /**
12578
+ * To get updated child records.
12579
+ *
12580
+ * @param {IGanttData} parentRecord .
12581
+ * @param {IGanttData} childLists .
12582
+ * @returns {void} .
12583
+ */
12584
+ getUpdatableChildRecords(parentRecord, childLists) {
12585
+ const childRecords = parentRecord.childRecords;
12586
+ for (let i = 0; i < childRecords.length; i++) {
12587
+ if (childRecords[i].ganttProperties.isAutoSchedule) {
12588
+ childLists.push(childRecords[i]);
12589
+ if (childRecords[i].hasChildRecords) {
12590
+ this.getUpdatableChildRecords(childRecords[i], childLists);
12591
+ }
12592
+ }
12593
+ }
12594
+ }
12595
+ /**
12596
+ *
12597
+ * @param {IGanttData} data .
12598
+ * @param {Date} newStartDate .
12599
+ * @returns {void} .
12600
+ */
12601
+ calculateDateByRoundOffDuration(data, newStartDate) {
12602
+ const ganttRecord = data;
12603
+ const taskData = ganttRecord.ganttProperties;
12604
+ const projectStartDate = new Date(newStartDate.getTime());
12605
+ if (!isNullOrUndefined(taskData.endDate) && isNullOrUndefined(taskData.startDate)) {
12606
+ const endDate = this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, null);
12607
+ this.parent.setRecordValue('endDate', this.parent.dateValidationModule.checkEndDate(endDate, ganttRecord.ganttProperties), taskData, true);
12608
+ }
12609
+ else {
12610
+ this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, false), taskData, true);
12611
+ if (!isNullOrUndefined(taskData.duration)) {
12612
+ this.parent.dateValidationModule.calculateEndDate(ganttRecord);
12613
+ }
12614
+ }
12615
+ this.parent.dataOperation.updateWidthLeft(data);
12616
+ this.parent.dataOperation.updateTaskData(ganttRecord);
12617
+ }
12488
12618
  /**
12489
12619
  * Method to get validate able predecessor alone from record
12490
12620
  *
@@ -16012,7 +16142,7 @@ let Gantt = class Gantt extends Component {
16012
16142
  this.treeGridModule.treeGridColumns = [];
16013
16143
  this.treeGridModule.validateGanttColumns();
16014
16144
  this.treeGrid.columns = this.treeGridModule.treeGridColumns;
16015
- this.treeGrid.grid.columns = this.treeGridModule.treeGridColumns;
16145
+ this.treeGrid.refreshColumns();
16016
16146
  this.chartRowsModule.initiateTemplates();
16017
16147
  this.timelineModule.updateChartByNewTimeline();
16018
16148
  break;
@@ -17059,6 +17189,19 @@ let Gantt = class Gantt extends Component {
17059
17189
  const tempSplitterSettings = {};
17060
17190
  tempSplitterSettings[type] = value;
17061
17191
  const splitterPosition = this.splitterModule.calculateSplitterPosition(tempSplitterSettings);
17192
+ switch (type) {
17193
+ case 'view':
17194
+ this.splitterSettings.view = tempSplitterSettings[type];
17195
+ break;
17196
+ case 'columnIndex':
17197
+ this.splitterSettings.columnIndex = tempSplitterSettings[type];
17198
+ break;
17199
+ case 'position':
17200
+ this.splitterSettings.position = tempSplitterSettings[type];
17201
+ break;
17202
+ default:
17203
+ break;
17204
+ }
17062
17205
  const pane1 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[0];
17063
17206
  const pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
17064
17207
  this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
@@ -19895,7 +20038,12 @@ class TaskbarEdit extends DateProcessor {
19895
20038
  event.preventDefault();
19896
20039
  if (!isNullOrUndefined(this.taskbarElement) && !isNullOrUndefined(this.editElement) && (this.taskBarEditAction !== "ConnectorPointRightDrag" && this.taskBarEditAction !== "ConnectorPointLeftDrag") && !(this.parent.viewType === 'ResourceView' && this.currentData.hasChildRecords)) {
19897
20040
  const currentElement = this.editElement.parentElement;
19898
- currentElement.style.setProperty("position", "absolute");
20041
+ if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
20042
+ currentElement.style.setProperty("position", "relative");
20043
+ }
20044
+ else {
20045
+ currentElement.style.setProperty("position", "absolute");
20046
+ }
19899
20047
  if ((this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'LeftResizing') && !isNullOrUndefined(this.currentIndex) && !isNullOrUndefined(this.currentIndex) ? Number(this.currentIndex) === 0 : false) {
19900
20048
  this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top", currentElement.parentElement.offsetTop + "px");
19901
20049
  if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
@@ -19914,8 +20062,14 @@ class TaskbarEdit extends DateProcessor {
19914
20062
  }
19915
20063
  }
19916
20064
  if (this.taskBarEditAction !== 'ProgressResizing') {
19917
- const rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container");
19918
- rootElement[0].appendChild(this.taskbarResizer);
20065
+ if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
20066
+ var rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-scroll-container");
20067
+ rootElement[0].appendChild(this.taskbarResizer);
20068
+ }
20069
+ else {
20070
+ var rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container");
20071
+ rootElement[0].appendChild(this.taskbarResizer);
20072
+ }
19919
20073
  }
19920
20074
  }
19921
20075
  if (this.parent.allowTaskbarDragAndDrop && (this.taskBarEditAction === "ChildDrag" || this.taskBarEditAction === "ParentDrag" ||
@@ -21040,7 +21194,12 @@ class TaskbarEdit extends DateProcessor {
21040
21194
  currentElement.style.position = null;
21041
21195
  }
21042
21196
  else {
21043
- currentElement.style.setProperty("position", "absolute");
21197
+ if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
21198
+ currentElement.style.setProperty("position", "relative");
21199
+ }
21200
+ else {
21201
+ currentElement.style.setProperty("position", "absolute");
21202
+ }
21044
21203
  }
21045
21204
  }
21046
21205
  const item = this.taskBarEditRecord.ganttProperties;
@@ -25683,7 +25842,7 @@ class Edit$2 {
25683
25842
  */
25684
25843
  this.deletedTaskDetails = [];
25685
25844
  this.parent = parent;
25686
- this.validatedChildItems = [];
25845
+ this.parent.predecessorModule.validatedChildItems = [];
25687
25846
  if (this.parent.editSettings.allowEditing && this.parent.editSettings.mode === 'Auto') {
25688
25847
  this.cellEditModule = new CellEdit(this.parent);
25689
25848
  }
@@ -26518,8 +26677,8 @@ class Edit$2 {
26518
26677
  }
26519
26678
  if (this.parent.isConnectorLineUpdate && this.parent.autoCalculateDateScheduling) {
26520
26679
  /* validating predecessor for updated child items */
26521
- for (let i = 0; i < this.validatedChildItems.length; i++) {
26522
- const child = this.validatedChildItems[i];
26680
+ for (let i = 0; i < this.parent.predecessorModule.validatedChildItems.length; i++) {
26681
+ const child = this.parent.predecessorModule.validatedChildItems[i];
26523
26682
  if (child.ganttProperties.predecessor && child.ganttProperties.predecessor.length > 0) {
26524
26683
  this.parent.editedTaskBarItem = child;
26525
26684
  this.parent.predecessorModule.validatePredecessor(child, [], '');
@@ -26533,6 +26692,7 @@ class Edit$2 {
26533
26692
  this.parent.editedTaskBarItem = ganttRecord;
26534
26693
  }
26535
26694
  if (!this.isValidatedEditedRecord) {
26695
+ this.isFirstCall = true;
26536
26696
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
26537
26697
  }
26538
26698
  this.isValidatedEditedRecord = false;
@@ -26540,7 +26700,7 @@ class Edit$2 {
26540
26700
  }
26541
26701
  if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
26542
26702
  (args.action === "DrawConnectorLine")) {
26543
- this.updateChildItems(ganttRecord);
26703
+ this.parent.predecessorModule['updateChildItems'](ganttRecord);
26544
26704
  }
26545
26705
  this.updateParentItemOnEditing();
26546
26706
  this.parent.dataOperation.updateParentItems(ganttRecord, true);
@@ -26553,6 +26713,7 @@ class Edit$2 {
26553
26713
  let parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
26554
26714
  if (!isNullOrUndefined(parentData)) {
26555
26715
  if (!parentData.ganttProperties.predecessorsName) {
26716
+ this.isFirstCall = true;
26556
26717
  this.parent.predecessorModule.validatePredecessor(parentData, [], '');
26557
26718
  this.updateParentItemOnEditing();
26558
26719
  this.parent.ganttChartModule.reRenderConnectorLines();
@@ -26583,7 +26744,7 @@ class Edit$2 {
26583
26744
  updateParentChildRecord(data) {
26584
26745
  const ganttRecord = data;
26585
26746
  if (ganttRecord.hasChildRecords && this.taskbarMoved && (ganttRecord[this.parent.taskFields.manual] === false || this.parent.taskMode === 'Auto') && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
26586
- this.updateChildItems(ganttRecord);
26747
+ this.parent.predecessorModule['updateChildItems'](ganttRecord);
26587
26748
  }
26588
26749
  if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
26589
26750
  this.parent.editModule.cellEditModule.isResourceCellEdited = false;
@@ -26628,29 +26789,6 @@ class Edit$2 {
26628
26789
  this.parent.dataOperation.updateWidthLeft(data);
26629
26790
  }
26630
26791
  }
26631
- /**
26632
- *
26633
- * @param {IGanttData} data .
26634
- * @param {Date} newStartDate .
26635
- * @returns {void} .
26636
- */
26637
- calculateDateByRoundOffDuration(data, newStartDate) {
26638
- const ganttRecord = data;
26639
- const taskData = ganttRecord.ganttProperties;
26640
- const projectStartDate = new Date(newStartDate.getTime());
26641
- if (!isNullOrUndefined(taskData.endDate) && isNullOrUndefined(taskData.startDate)) {
26642
- const endDate = this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, null);
26643
- this.parent.setRecordValue('endDate', this.parent.dateValidationModule.checkEndDate(endDate, ganttRecord.ganttProperties), taskData, true);
26644
- }
26645
- else {
26646
- this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, false), taskData, true);
26647
- if (!isNullOrUndefined(taskData.duration)) {
26648
- this.parent.dateValidationModule.calculateEndDate(ganttRecord);
26649
- }
26650
- }
26651
- this.parent.dataOperation.updateWidthLeft(data);
26652
- this.parent.dataOperation.updateTaskData(ganttRecord);
26653
- }
26654
26792
  /**
26655
26793
  * To update progress value of parent tasks
26656
26794
  *
@@ -26760,106 +26898,6 @@ class Edit$2 {
26760
26898
  updateScheduleDatesOnEditing(args) {
26761
26899
  //..
26762
26900
  }
26763
- /**
26764
- *
26765
- * @param {IGanttData} ganttRecord .
26766
- * @returns {void} .
26767
- */
26768
- updateChildItems(ganttRecord) {
26769
- const previousData = this.parent.previousRecords[ganttRecord.uniqueID];
26770
- let previousStartDate;
26771
- if (isNullOrUndefined(previousData) ||
26772
- (isNullOrUndefined(previousData) && !isNullOrUndefined(previousData.ganttProperties))) {
26773
- previousStartDate = new Date(ganttRecord.ganttProperties.startDate.getTime());
26774
- }
26775
- else {
26776
- if (!isNullOrUndefined(previousData.ganttProperties.startDate)) {
26777
- previousStartDate = new Date(previousData.ganttProperties.startDate.getTime());
26778
- }
26779
- }
26780
- const currentStartDate = ganttRecord.ganttProperties.startDate;
26781
- const childRecords = [];
26782
- let validStartDate;
26783
- let validEndDate;
26784
- let calcEndDate;
26785
- let isRightMove;
26786
- let durationDiff;
26787
- this.getUpdatableChildRecords(ganttRecord, childRecords);
26788
- if (childRecords.length === 0) {
26789
- return;
26790
- }
26791
- if (!isNullOrUndefined(previousStartDate) && !isNullOrUndefined(currentStartDate) && previousStartDate.getTime() > currentStartDate.getTime()) {
26792
- validStartDate = this.parent.dateValidationModule.checkStartDate(currentStartDate);
26793
- validEndDate = this.parent.dateValidationModule.checkEndDate(previousStartDate, ganttRecord.ganttProperties);
26794
- isRightMove = false;
26795
- }
26796
- else {
26797
- validStartDate = this.parent.dateValidationModule.checkStartDate(previousStartDate);
26798
- validEndDate = this.parent.dateValidationModule.checkEndDate(currentStartDate, ganttRecord.ganttProperties);
26799
- isRightMove = true;
26800
- }
26801
- //Get Duration
26802
- if (!isNullOrUndefined(validStartDate) && !isNullOrUndefined(validEndDate) && validStartDate.getTime() >= validEndDate.getTime()) {
26803
- durationDiff = 0;
26804
- }
26805
- else {
26806
- durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
26807
- }
26808
- for (let i = 0; i < childRecords.length; i++) {
26809
- if (childRecords[i].ganttProperties.isAutoSchedule) {
26810
- if (durationDiff > 0) {
26811
- const startDate = isScheduledTask(childRecords[i].ganttProperties) ?
26812
- childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
26813
- childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.endDate ?
26814
- childRecords[i].ganttProperties.endDate : new Date(previousStartDate.toString());
26815
- if (isRightMove) {
26816
- calcEndDate = this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(startDate, childRecords[i].ganttProperties, childRecords[i].ganttProperties.isMilestone), durationDiff, 'minute', childRecords[i].ganttProperties, false);
26817
- }
26818
- else {
26819
- calcEndDate = this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(startDate, childRecords[i].ganttProperties), durationDiff, 'minute', childRecords[i].ganttProperties);
26820
- }
26821
- this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
26822
- if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
26823
- this.validatedChildItems.push(childRecords[i]);
26824
- }
26825
- }
26826
- else if (isNullOrUndefined(previousData)) {
26827
- calcEndDate = previousStartDate;
26828
- const initialData = this.parent.initialLoadData[childRecords[i].index];
26829
- if (this.parent.isLoad) {
26830
- this.calculateDateByRoundOffDuration(initialData, calcEndDate);
26831
- }
26832
- else {
26833
- this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
26834
- }
26835
- if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
26836
- this.validatedChildItems.push(childRecords[i]);
26837
- }
26838
- }
26839
- }
26840
- }
26841
- if (childRecords.length) {
26842
- this.parent.dataOperation.updateParentItems(ganttRecord, true);
26843
- }
26844
- }
26845
- /**
26846
- * To get updated child records.
26847
- *
26848
- * @param {IGanttData} parentRecord .
26849
- * @param {IGanttData} childLists .
26850
- * @returns {void} .
26851
- */
26852
- getUpdatableChildRecords(parentRecord, childLists) {
26853
- const childRecords = parentRecord.childRecords;
26854
- for (let i = 0; i < childRecords.length; i++) {
26855
- if (childRecords[i].ganttProperties.isAutoSchedule) {
26856
- childLists.push(childRecords[i]);
26857
- if (childRecords[i].hasChildRecords) {
26858
- this.getUpdatableChildRecords(childRecords[i], childLists);
26859
- }
26860
- }
26861
- }
26862
- }
26863
26901
  /**
26864
26902
  * @param {ITaskbarEditedEventArgs} args .
26865
26903
  * @returns {void} .
@@ -27371,7 +27409,7 @@ class Edit$2 {
27371
27409
  this.resetValidateArgs();
27372
27410
  this.parent.editedTaskBarItem = null;
27373
27411
  this.parent.isOnEdit = false;
27374
- this.validatedChildItems = [];
27412
+ this.parent.predecessorModule.validatedChildItems = [];
27375
27413
  this.parent.isConnectorLineUpdate = false;
27376
27414
  this.parent.editedTaskBarItem = null;
27377
27415
  this.taskbarMoved = false;
@@ -29260,6 +29298,7 @@ class Edit$2 {
29260
29298
  for (let k = 0; k < this.updateParentRecords.length; k++) {
29261
29299
  this.parent.dataOperation.updateParentItems(this.updateParentRecords[k]);
29262
29300
  }
29301
+ this.isFirstCall = true;
29263
29302
  this.parent.editedRecords.forEach(record => {
29264
29303
  this.parent.predecessorModule.validatePredecessor(record, [], '');
29265
29304
  });
@@ -30302,7 +30341,14 @@ class Selection$1 {
30302
30341
  if (this.parent.enableTimelineVirtualization) {
30303
30342
  this.parent['isRowSelected'] = true;
30304
30343
  }
30305
- this.parent.ganttChartModule.updateScrollLeft(getValue('data.ganttProperties.left', args));
30344
+ if (args.data && !isNullOrUndefined(args.data['length'])) {
30345
+ for (let i = 0; i < args.data['length']; i++) {
30346
+ this.parent.ganttChartModule.updateScrollLeft(args.data[i].ganttProperties.left);
30347
+ }
30348
+ }
30349
+ else {
30350
+ this.parent.ganttChartModule.updateScrollLeft(getValue('data.ganttProperties.left', args));
30351
+ }
30306
30352
  }
30307
30353
  args.target = this.actualTarget;
30308
30354
  if (!isNullOrUndefined(args.foreignKeyData) && Object.keys(args.foreignKeyData).length === 0) {