@syncfusion/ej2-gantt 22.1.37 → 22.1.38

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.
@@ -1474,8 +1474,16 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
1474
1474
  viewData.forEach(function (data) {
1475
1475
  taskRange = [];
1476
1476
  var task = data.ganttProperties;
1477
- var tempStartDate = _this.getValidStartDate(task);
1478
- var tempEndDate = _this.getValidEndDate(task);
1477
+ var tempStartDate;
1478
+ var tempEndDate;
1479
+ if (isNullOrUndefined(task.startDate) && isNullOrUndefined(task.endDate)) {
1480
+ tempStartDate = null;
1481
+ tempEndDate = null;
1482
+ }
1483
+ else {
1484
+ tempStartDate = _this.getValidStartDate(task);
1485
+ tempEndDate = _this.getValidEndDate(task);
1486
+ }
1479
1487
  addDateToList(minStartDate);
1480
1488
  addDateToList(maxEndDate);
1481
1489
  addDateToList(tempStartDate);
@@ -5188,7 +5196,6 @@ var GanttChart = /** @__PURE__ @class */ (function () {
5188
5196
  this.updateWidthAndHeight();
5189
5197
  this.reRenderConnectorLines();
5190
5198
  getValue('chartRow', args).setAttribute('aria-expanded', 'false');
5191
- this.parent.trigger('collapsed', args);
5192
5199
  };
5193
5200
  /**
5194
5201
  * To expand gantt rows
@@ -5243,7 +5250,6 @@ var GanttChart = /** @__PURE__ @class */ (function () {
5243
5250
  this.updateWidthAndHeight();
5244
5251
  this.reRenderConnectorLines();
5245
5252
  getValue('chartRow', args).setAttribute('aria-expanded', 'true');
5246
- this.parent.trigger('expanded', args);
5247
5253
  };
5248
5254
  GanttChart.prototype.renderMultiTaskbar = function (record) {
5249
5255
  if (this.parent.enableMultiTaskbar) {
@@ -5287,20 +5293,27 @@ var GanttChart = /** @__PURE__ @class */ (function () {
5287
5293
  removeClass([targetElement[t]], 'e-row-expand');
5288
5294
  }
5289
5295
  }
5290
- var childRecords = record.childRecords;
5291
- var chartRows = this.getChartRows();
5292
- var rows = [];
5293
- for (var i = 0; i < chartRows.length; i++) {
5294
- if (chartRows[i].classList.contains('gridrowtaskId'
5295
- + record.ganttProperties.rowUniqueID + 'level' + (record.level + 1))) {
5296
- rows.push(chartRows[i]);
5296
+ if (!this.parent.enableVirtualization) {
5297
+ var childRecords = record.childRecords;
5298
+ var chartRows = this.getChartRows();
5299
+ var rows = [];
5300
+ for (var i = 0; i < chartRows.length; i++) {
5301
+ if (chartRows[i].classList.contains("gridrowtaskId" +
5302
+ record.ganttProperties.rowUniqueID +
5303
+ "level" +
5304
+ (record.level + 1))) {
5305
+ rows.push(chartRows[i]);
5306
+ }
5297
5307
  }
5298
- }
5299
- for (var i = 0; i < rows.length; i++) {
5300
- rows[i].style.display = displayType;
5301
- if ((childRecords[i].childRecords && childRecords[i].childRecords.length)
5302
- && (action === 'collapse' || childRecords[i].expanded || this.isExpandAll)) {
5303
- this.expandCollapseChartRows(action, rows[i], childRecords[i], true);
5308
+ for (var i = 0; i < rows.length; i++) {
5309
+ rows[i].style.display = displayType;
5310
+ if (childRecords[i].childRecords &&
5311
+ childRecords[i].childRecords.length &&
5312
+ (action === "collapse" ||
5313
+ childRecords[i].expanded ||
5314
+ this.isExpandAll)) {
5315
+ this.expandCollapseChartRows(action, rows[i], childRecords[i], true);
5316
+ }
5304
5317
  }
5305
5318
  }
5306
5319
  };
@@ -6155,6 +6168,8 @@ var Timeline = /** @__PURE__ @class */ (function () {
6155
6168
  this.parent.showSpinner();
6156
6169
  }
6157
6170
  this.changeTimelineSettings(newTimeline);
6171
+ this.isZoomToFit = false;
6172
+ this.parent.isTimelineRoundOff = this.isZoomToFit ? false : isNullOrUndefined(this.parent.projectStartDate) ? true : false;
6158
6173
  };
6159
6174
  Timeline.prototype.bottomTierCellWidthCalc = function (mode, zoomLevel, date) {
6160
6175
  var convertedMilliSeconds;
@@ -7678,25 +7693,60 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7678
7693
  GanttTreeGrid.prototype.collapsing = function (args) {
7679
7694
  // Collapsing event
7680
7695
  var callBackPromise = new Deferred();
7696
+ var collapsingArgs;
7697
+ var record = getValue('data', args);
7698
+ var recordLength = record.length;
7681
7699
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart) {
7682
- var collapsingArgs = this.createExpandCollapseArgs(args);
7683
- this.parent.ganttChartModule.collapseGanttRow(collapsingArgs);
7684
- setValue('cancel', getValue('cancel', collapsingArgs), args);
7700
+ if (!isNullOrUndefined(recordLength)) {
7701
+ for (var i = 0; i < recordLength; i++) {
7702
+ collapsingArgs = this.createExpandCollapseArgs(args, record[i]);
7703
+ this.parent.ganttChartModule.collapseGanttRow(collapsingArgs);
7704
+ }
7705
+ setValue('cancel', getValue('cancel', collapsingArgs), args);
7706
+ }
7707
+ else {
7708
+ collapsingArgs = this.createExpandCollapseArgs(args, null);
7709
+ this.parent.ganttChartModule.collapseGanttRow(collapsingArgs);
7710
+ setValue('cancel', getValue('cancel', collapsingArgs), args);
7711
+ }
7685
7712
  }
7686
7713
  };
7687
7714
  GanttTreeGrid.prototype.expanding = function (args) {
7688
7715
  // Expanding event
7689
7716
  var callBackPromise = new Deferred();
7717
+ var expandingArgs;
7718
+ var record = getValue('data', args);
7719
+ var recordLength = record.length;
7690
7720
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart) {
7691
- var expandingArgs = this.createExpandCollapseArgs(args);
7692
- this.parent.ganttChartModule.expandGanttRow(expandingArgs);
7693
- setValue('cancel', getValue('cancel', expandingArgs), args);
7721
+ if (!isNullOrUndefined(recordLength)) {
7722
+ for (var i = 0; i < recordLength; i++) {
7723
+ expandingArgs = this.createExpandCollapseArgs(args, record[i]);
7724
+ this.parent.ganttChartModule.expandGanttRow(expandingArgs);
7725
+ }
7726
+ setValue('cancel', getValue('cancel', expandingArgs), args);
7727
+ }
7728
+ else {
7729
+ expandingArgs = this.createExpandCollapseArgs(args, null);
7730
+ this.parent.ganttChartModule.expandGanttRow(expandingArgs);
7731
+ setValue('cancel', getValue('cancel', expandingArgs), args);
7732
+ }
7694
7733
  }
7695
7734
  };
7696
7735
  GanttTreeGrid.prototype.collapsed = function (args) {
7697
7736
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart && !this.parent.isExpandCollapseLevelMethod) {
7698
- var collapsedArgs = this.createExpandCollapseArgs(args);
7699
- this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
7737
+ var collapsedArgs = void 0;
7738
+ var record = getValue('data', args);
7739
+ var recordLength = record.length;
7740
+ if (!isNullOrUndefined(recordLength)) {
7741
+ for (var i = 0; i < recordLength; i++) {
7742
+ collapsedArgs = this.createExpandCollapseArgs(args, record[i]);
7743
+ this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
7744
+ }
7745
+ }
7746
+ else {
7747
+ collapsedArgs = this.createExpandCollapseArgs(args, null);
7748
+ this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
7749
+ }
7700
7750
  if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
7701
7751
  collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
7702
7752
  this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
@@ -7710,19 +7760,29 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7710
7760
  else {
7711
7761
  this.parent.hideSpinner();
7712
7762
  }
7763
+ this.parent.trigger('collapsed', args);
7713
7764
  };
7714
7765
  GanttTreeGrid.prototype.expanded = function (args) {
7715
7766
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart && !this.parent.isExpandCollapseLevelMethod) {
7716
- if (!args['data'].length) {
7717
- var expandedArgs = this.createExpandCollapseArgs(args);
7718
- this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
7719
- if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
7720
- args['row'].style.height = this.parent.rowHeight + 'px';
7721
- this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
7722
- this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
7723
- document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
7767
+ var expandedArgs = void 0;
7768
+ var record = getValue('data', args);
7769
+ var recordLength = record.length;
7770
+ if (!isNullOrUndefined(recordLength)) {
7771
+ for (var i = 0; i < recordLength; i++) {
7772
+ expandedArgs = this.createExpandCollapseArgs(args, record[i]);
7773
+ this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
7724
7774
  }
7725
7775
  }
7776
+ else {
7777
+ expandedArgs = this.createExpandCollapseArgs(args, null);
7778
+ this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
7779
+ }
7780
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
7781
+ args['row'].style.height = this.parent.rowHeight + 'px';
7782
+ this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
7783
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
7784
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
7785
+ }
7726
7786
  }
7727
7787
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
7728
7788
  this.parent.hideMaskRow();
@@ -7730,6 +7790,7 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7730
7790
  else {
7731
7791
  this.parent.hideSpinner();
7732
7792
  }
7793
+ this.parent.trigger('expanded', args);
7733
7794
  };
7734
7795
  GanttTreeGrid.prototype.actionBegin = function (args) {
7735
7796
  this.parent.notify('actionBegin', args);
@@ -7753,13 +7814,23 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7753
7814
  GanttTreeGrid.prototype.actionFailure = function (args) {
7754
7815
  this.parent.trigger('actionFailure', args);
7755
7816
  };
7756
- GanttTreeGrid.prototype.createExpandCollapseArgs = function (args) {
7757
- var record = getValue('data', args);
7758
- var gridRow = getValue('row', args);
7817
+ GanttTreeGrid.prototype.createExpandCollapseArgs = function (args, currentRecord) {
7759
7818
  var chartRow;
7760
- chartRow = this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(record)];
7761
- var eventArgs = { data: record, gridRow: gridRow, chartRow: chartRow, cancel: false };
7762
- return eventArgs;
7819
+ var record = getValue('data', args);
7820
+ var recordLength = record.length;
7821
+ if (!isNullOrUndefined(recordLength)) {
7822
+ var gridRow = getValue('row', args);
7823
+ chartRow = this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(currentRecord)];
7824
+ var eventArgs = { data: currentRecord, gridRow: gridRow, chartRow: chartRow, cancel: false };
7825
+ return eventArgs;
7826
+ }
7827
+ else {
7828
+ var record_1 = getValue('data', args);
7829
+ var gridRow = getValue('row', args);
7830
+ chartRow = this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(record_1)];
7831
+ var eventArgs = { data: record_1, gridRow: gridRow, chartRow: chartRow, cancel: false };
7832
+ return eventArgs;
7833
+ }
7763
7834
  };
7764
7835
  GanttTreeGrid.prototype.treeActionComplete = function (args) {
7765
7836
  var updatedArgs = extend({}, args);
@@ -11562,6 +11633,9 @@ var Dependency = /** @__PURE__ @class */ (function () {
11562
11633
  ganttRecord = predecessorsCollection[count];
11563
11634
  if ((!ganttRecord.hasChildRecords && !this.parent.allowParentDependency) || this.parent.allowParentDependency) {
11564
11635
  this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
11636
+ if (!ganttRecord.ganttProperties.isAutoSchedule) {
11637
+ this.parent.connectorLineEditModule['calculateOffset'](ganttRecord);
11638
+ }
11565
11639
  }
11566
11640
  }
11567
11641
  };
@@ -11992,6 +12066,9 @@ var Dependency = /** @__PURE__ @class */ (function () {
11992
12066
  if (validationOn !== 'predecessor' && this.parent.isValidationEnabled) {
11993
12067
  this.validateChildGanttRecord(parentGanttRecord, record);
11994
12068
  }
12069
+ else if (!record.ganttProperties.isAutoSchedule && this.parent.UpdateOffsetOnTaskbarEdit) {
12070
+ this.parent.connectorLineEditModule['calculateOffset'](record);
12071
+ }
11995
12072
  if (parentGanttRecord.expanded === false || record.expanded === false) {
11996
12073
  if (record) {
11997
12074
  this.validatePredecessor(record, undefined, 'successor');
@@ -30881,65 +30958,79 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
30881
30958
  }
30882
30959
  switch (this.item) {
30883
30960
  case 'TaskInformation':
30884
- if (isNaN(Number(this.rowData.ganttProperties.rowUniqueID))) {
30885
- this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID);
30886
- }
30887
- else {
30888
- this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));
30961
+ if (!isNullOrUndefined(this.rowData)) {
30962
+ if (isNaN(Number(this.rowData.ganttProperties.rowUniqueID))) {
30963
+ this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID);
30964
+ }
30965
+ else {
30966
+ this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));
30967
+ }
30889
30968
  }
30890
30969
  break;
30891
30970
  case 'Above':
30892
30971
  case 'Below':
30893
30972
  case 'Child':
30894
- position = this.item;
30895
- data = extend({}, {}, this.rowData.taskData, true);
30896
- taskfields = this.parent.taskFields;
30897
- if (data[taskfields.startDate]) {
30898
- this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
30899
- }
30900
- if (data[taskfields.endDate]) {
30901
- this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
30902
- }
30903
- if (!isNullOrUndefined(taskfields.dependency)) {
30904
- data[taskfields.dependency] = null;
30905
- }
30906
- if (!isNullOrUndefined(taskfields.child) && data[taskfields.child]) {
30907
- delete data[taskfields.child];
30908
- }
30909
- if (!isNullOrUndefined(taskfields.parentID) && data[taskfields.parentID]) {
30910
- data[taskfields.parentID] = null;
30973
+ if (!isNullOrUndefined(this.rowData)) {
30974
+ position = this.item;
30975
+ data = extend({}, {}, this.rowData.taskData, true);
30976
+ taskfields = this.parent.taskFields;
30977
+ if (data[taskfields.startDate]) {
30978
+ this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
30979
+ }
30980
+ if (data[taskfields.endDate]) {
30981
+ this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
30982
+ }
30983
+ if (!isNullOrUndefined(taskfields.dependency)) {
30984
+ data[taskfields.dependency] = null;
30985
+ }
30986
+ if (!isNullOrUndefined(taskfields.child) && data[taskfields.child]) {
30987
+ delete data[taskfields.child];
30988
+ }
30989
+ if (!isNullOrUndefined(taskfields.parentID) && data[taskfields.parentID]) {
30990
+ data[taskfields.parentID] = null;
30991
+ }
30992
+ if (this.rowData) {
30993
+ var rowIndex = this.parent.updatedRecords.indexOf(this.rowData);
30994
+ this.parent.addRecord(data, position, rowIndex);
30995
+ }
30911
30996
  }
30912
- if (this.rowData) {
30913
- var rowIndex = this.parent.updatedRecords.indexOf(this.rowData);
30914
- this.parent.addRecord(data, position, rowIndex);
30997
+ else if (this.parent.flatData.length === 0) {
30998
+ this.parent.addRecord();
30915
30999
  }
30916
31000
  break;
30917
31001
  case 'Milestone':
30918
31002
  case 'ToMilestone':
30919
- this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);
31003
+ if (!isNullOrUndefined(this.rowData)) {
31004
+ this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);
31005
+ }
31006
+ else if (this.parent.flatData.length === 0) {
31007
+ this.parent.addRecord();
31008
+ }
30920
31009
  break;
30921
31010
  case 'DeleteTask':
30922
31011
  this.parent.editModule.deleteRecord(this.rowData);
30923
31012
  break;
30924
31013
  case 'ToTask':
30925
- data = extend({}, {}, this.rowData.taskData, true);
30926
- taskfields = this.parent.taskFields;
30927
- if (!isNullOrUndefined(taskfields.duration)) {
30928
- var ganttProp = this.rowData.ganttProperties;
30929
- data[taskfields.duration] = '1 ' + ganttProp.durationUnit;
30930
- }
30931
- else {
30932
- data[taskfields.startDate] = new Date(this.rowData.taskData[taskfields.startDate]);
30933
- var endDate = new Date(this.rowData.taskData[taskfields.startDate]);
30934
- endDate.setDate(endDate.getDate() + 1);
30935
- data[taskfields.endDate] = endDate;
30936
- }
30937
- if (!isNullOrUndefined(data[taskfields.milestone])) {
30938
- if (data[taskfields.milestone] === true) {
30939
- data[taskfields.milestone] = false;
31014
+ if (!isNullOrUndefined(this.rowData)) {
31015
+ data = extend({}, {}, this.rowData.taskData, true);
31016
+ taskfields = this.parent.taskFields;
31017
+ if (!isNullOrUndefined(taskfields.duration)) {
31018
+ var ganttProp = this.rowData.ganttProperties;
31019
+ data[taskfields.duration] = '1 ' + ganttProp.durationUnit;
30940
31020
  }
31021
+ else {
31022
+ data[taskfields.startDate] = new Date(this.rowData.taskData[taskfields.startDate]);
31023
+ var endDate = new Date(this.rowData.taskData[taskfields.startDate]);
31024
+ endDate.setDate(endDate.getDate() + 1);
31025
+ data[taskfields.endDate] = endDate;
31026
+ }
31027
+ if (!isNullOrUndefined(data[taskfields.milestone])) {
31028
+ if (data[taskfields.milestone] === true) {
31029
+ data[taskfields.milestone] = false;
31030
+ }
31031
+ }
31032
+ this.parent.updateRecordByID(data);
30941
31033
  }
30942
- this.parent.updateRecordByID(data);
30943
31034
  break;
30944
31035
  case 'Cancel':
30945
31036
  this.parent.cancelEdit();
@@ -31095,7 +31186,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
31095
31186
  this.contextMenu.enableItems(['Add', 'Save', 'Convert', 'Delete Dependency', 'Delete Task', 'TaskMode', 'Indent', 'Outdent', 'SplitTask', 'MergeTask'], false);
31096
31187
  }
31097
31188
  if ((isNullOrUndefined(args.gridRow) && isNullOrUndefined(args.chartRow)) || this.contentMenuItems.length === 0) {
31098
- if (!isNullOrUndefined(args.parentItem) && !isNullOrUndefined(menuElement)) {
31189
+ if (!isNullOrUndefined(args.parentItem) && !isNullOrUndefined(menuElement) || !isNullOrUndefined(closest(target, '.e-content'))) {
31099
31190
  args.cancel = false;
31100
31191
  }
31101
31192
  else {
@@ -31135,7 +31226,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
31135
31226
  args.disableItems = this.disableItems;
31136
31227
  args.hideItems = this.hideItems;
31137
31228
  args.hideChildItems = [];
31138
- if (args.rowData.level === 0 && this.parent.viewType === 'ResourceView') {
31229
+ if (!isNullOrUndefined(args.rowData) && args.rowData.level === 0 && this.parent.viewType === 'ResourceView') {
31139
31230
  args.cancel = true;
31140
31231
  return;
31141
31232
  }
@@ -31177,6 +31268,9 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
31177
31268
  if (!this.parent.editSettings.allowEditing || !this.parent.editModule) {
31178
31269
  this.updateItemVisibility(item.text);
31179
31270
  }
31271
+ if (this.parent.flatData.length === 0) {
31272
+ this.hideItems.push(item.text);
31273
+ }
31180
31274
  break;
31181
31275
  case 'Add':
31182
31276
  if (!this.parent.editSettings.allowAdding || !this.parent.editModule) {
@@ -31188,14 +31282,14 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
31188
31282
  this.hideItems.push(item.text);
31189
31283
  break;
31190
31284
  case 'Convert':
31191
- if (this.rowData.hasChildRecords) {
31285
+ if (!isNullOrUndefined(this.rowData) && this.rowData.hasChildRecords) {
31192
31286
  this.hideItems.push(item.text);
31193
31287
  }
31194
31288
  else if (!this.parent.editSettings.allowEditing || !this.parent.editModule) {
31195
31289
  this.updateItemVisibility(item.text);
31196
31290
  }
31197
31291
  else {
31198
- if (!this.rowData.ganttProperties.isMilestone) {
31292
+ if (!isNullOrUndefined(this.rowData) && !this.rowData.ganttProperties.isMilestone) {
31199
31293
  subMenu.push(this.createItemModel(content, 'ToMilestone', this.getLocale('toMilestone')));
31200
31294
  }
31201
31295
  else {
@@ -31203,11 +31297,14 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
31203
31297
  }
31204
31298
  item.items = subMenu;
31205
31299
  }
31300
+ if (this.parent.flatData.length === 0) {
31301
+ this.hideItems.push(item.text);
31302
+ }
31206
31303
  break;
31207
31304
  case 'DeleteDependency':
31208
31305
  {
31209
31306
  var items = this.getPredecessorsItems();
31210
- if (this.rowData.hasChildRecords) {
31307
+ if (!isNullOrUndefined(this.rowData) && this.rowData.hasChildRecords) {
31211
31308
  this.hideItems.push(item.text);
31212
31309
  }
31213
31310
  else if (!this.parent.editSettings.allowDeleting || items.length === 0 || !this.parent.editModule) {
@@ -31222,6 +31319,9 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
31222
31319
  if (!this.parent.editSettings.allowDeleting || !this.parent.editModule) {
31223
31320
  this.updateItemVisibility(item.text);
31224
31321
  }
31322
+ if (this.parent.flatData.length === 0) {
31323
+ this.hideItems.push(item.text);
31324
+ }
31225
31325
  break;
31226
31326
  case 'TaskMode':
31227
31327
  if (this.parent.taskMode !== 'Custom') {