@syncfusion/ej2-treegrid 25.2.6 → 26.1.39

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.
Files changed (102) hide show
  1. package/.eslintrc.json +3 -2
  2. package/dist/ej2-treegrid.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js +2 -2
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +649 -467
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +950 -767
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +2 -2
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +10 -10
  13. package/src/treegrid/actions/edit.js +8 -7
  14. package/src/treegrid/actions/excel-export.js +16 -4
  15. package/src/treegrid/actions/page.js +4 -0
  16. package/src/treegrid/actions/rowdragdrop.js +13 -11
  17. package/src/treegrid/actions/selection.js +4 -1
  18. package/src/treegrid/base/constant.d.ts +2 -0
  19. package/src/treegrid/base/constant.js +2 -0
  20. package/src/treegrid/base/data.js +8 -3
  21. package/src/treegrid/base/interface.js +0 -1
  22. package/src/treegrid/base/treegrid-model.d.ts +1 -1
  23. package/src/treegrid/base/treegrid.d.ts +3 -0
  24. package/src/treegrid/base/treegrid.js +238 -63
  25. package/src/treegrid/renderer/virtual-row-model-generator.js +2 -2
  26. package/src/treegrid/renderer/virtual-tree-content-render.js +6 -3
  27. package/styles/bootstrap-dark.css +76 -48
  28. package/styles/bootstrap-dark.scss +18 -1
  29. package/styles/bootstrap.css +76 -49
  30. package/styles/bootstrap.scss +18 -1
  31. package/styles/bootstrap4.css +77 -48
  32. package/styles/bootstrap4.scss +18 -1
  33. package/styles/bootstrap5-dark.css +77 -49
  34. package/styles/bootstrap5-dark.scss +18 -1
  35. package/styles/bootstrap5.css +77 -49
  36. package/styles/bootstrap5.scss +18 -1
  37. package/styles/fabric-dark.css +74 -47
  38. package/styles/fabric-dark.scss +18 -1
  39. package/styles/fabric.css +74 -47
  40. package/styles/fabric.scss +18 -1
  41. package/styles/fluent-dark.css +77 -49
  42. package/styles/fluent-dark.scss +18 -1
  43. package/styles/fluent.css +77 -49
  44. package/styles/fluent.scss +18 -1
  45. package/styles/fluent2.css +1713 -0
  46. package/styles/fluent2.scss +18 -0
  47. package/styles/highcontrast-light.css +74 -47
  48. package/styles/highcontrast-light.scss +18 -1
  49. package/styles/highcontrast.css +74 -47
  50. package/styles/highcontrast.scss +18 -1
  51. package/styles/material-dark.css +111 -54
  52. package/styles/material-dark.scss +18 -1
  53. package/styles/material.css +125 -57
  54. package/styles/material.scss +18 -1
  55. package/styles/material3-dark.css +111 -56
  56. package/styles/material3-dark.scss +18 -1
  57. package/styles/material3.css +111 -56
  58. package/styles/material3.scss +18 -1
  59. package/styles/tailwind-dark.css +87 -51
  60. package/styles/tailwind-dark.scss +18 -1
  61. package/styles/tailwind.css +87 -51
  62. package/styles/tailwind.scss +18 -1
  63. package/styles/treegrid/_bds-definition.scss +0 -4
  64. package/styles/treegrid/_bootstrap-dark-definition.scss +0 -1
  65. package/styles/treegrid/_bootstrap-definition.scss +0 -1
  66. package/styles/treegrid/_bootstrap4-definition.scss +0 -1
  67. package/styles/treegrid/_bootstrap5-definition.scss +0 -4
  68. package/styles/treegrid/_bootstrap5.3-definition.scss +24 -0
  69. package/styles/treegrid/_fabric-dark-definition.scss +0 -1
  70. package/styles/treegrid/_fabric-definition.scss +0 -1
  71. package/styles/treegrid/_fluent-definition.scss +0 -4
  72. package/styles/treegrid/_fluent2-definition.scss +24 -0
  73. package/styles/treegrid/_fusionnew-definition.scss +0 -4
  74. package/styles/treegrid/_highcontrast-definition.scss +0 -1
  75. package/styles/treegrid/_highcontrast-light-definition.scss +0 -1
  76. package/styles/treegrid/_layout.scss +81 -85
  77. package/styles/treegrid/_material-dark-definition.scss +0 -1
  78. package/styles/treegrid/_material-definition.scss +0 -1
  79. package/styles/treegrid/_material3-definition.scss +0 -4
  80. package/styles/treegrid/_tailwind-definition.scss +0 -4
  81. package/styles/treegrid/bootstrap-dark.css +76 -48
  82. package/styles/treegrid/bootstrap.css +76 -49
  83. package/styles/treegrid/bootstrap4.css +77 -48
  84. package/styles/treegrid/bootstrap5-dark.css +77 -49
  85. package/styles/treegrid/bootstrap5.css +77 -49
  86. package/styles/treegrid/fabric-dark.css +74 -47
  87. package/styles/treegrid/fabric.css +74 -47
  88. package/styles/treegrid/fluent-dark.css +77 -49
  89. package/styles/treegrid/fluent.css +77 -49
  90. package/styles/treegrid/fluent2.css +1713 -0
  91. package/styles/treegrid/fluent2.scss +18 -0
  92. package/styles/treegrid/highcontrast-light.css +74 -47
  93. package/styles/treegrid/highcontrast.css +74 -47
  94. package/styles/treegrid/icons/_bootstrap5.3.scss +37 -0
  95. package/styles/treegrid/icons/_fluent2.scss +37 -0
  96. package/styles/treegrid/material-dark.css +111 -54
  97. package/styles/treegrid/material.css +125 -57
  98. package/styles/treegrid/material3-dark.css +111 -56
  99. package/styles/treegrid/material3.css +111 -56
  100. package/styles/treegrid/tailwind-dark.css +87 -51
  101. package/styles/treegrid/tailwind.css +87 -51
  102. package/CHANGELOG.md +0 -264
@@ -23,7 +23,7 @@ import { Event, Property, NotifyPropertyChanges, setValue, KeyboardEvents, L10n
23
23
  import { Column } from '../models/column';
24
24
  import { getNumberFormat } from '@syncfusion/ej2-grids';
25
25
  import { Freeze as FreezeColumn } from '@syncfusion/ej2-grids';
26
- import { RowDropSettings, getUid } from '@syncfusion/ej2-grids';
26
+ import { RowDropSettings, getUid, parentsUntil } from '@syncfusion/ej2-grids';
27
27
  import { LoadingIndicator } from '../models/loading-indicator';
28
28
  import { FilterSettings } from '../models/filter-settings';
29
29
  import { TextWrapSettings } from '../models/textwrap-settings';
@@ -184,6 +184,7 @@ var TreeGrid = /** @class */ (function (_super) {
184
184
  };
185
185
  /**
186
186
  * Exports the TreeGrid data to the specified URL using a POST request.
187
+ *
187
188
  * @param {string} url - Defines exporting url
188
189
  * @returns {void}
189
190
  */
@@ -214,6 +215,7 @@ var TreeGrid = /** @class */ (function (_super) {
214
215
  };
215
216
  /**
216
217
  * Sets the header text and other properties for an array of columns based on specified criteria.
218
+ *
217
219
  * @param {Column[]} columns - Defines array of columns
218
220
  * @param {string[]} include - Defines array of sting
219
221
  * @returns {Column[]} returns array of columns
@@ -300,6 +302,10 @@ var TreeGrid = /** @class */ (function (_super) {
300
302
  * @returns {void}
301
303
  */
302
304
  TreeGrid.prototype.sortByColumn = function (columnName, direction, isMultiSort) {
305
+ if (isNullOrUndefined(columnName) && isNullOrUndefined(direction)) {
306
+ var error = 'The provided value for the columnName and direction is undefined. Please ensure the columnName and direction contains string.';
307
+ this.trigger(events.actionFailure, { error: error });
308
+ }
303
309
  if (this.sortModule) {
304
310
  this.sortModule.sortColumn(columnName, direction, isMultiSort);
305
311
  }
@@ -360,21 +366,27 @@ var TreeGrid = /** @class */ (function (_super) {
360
366
  * @returns {void}
361
367
  */
362
368
  TreeGrid.prototype.reorderColumns = function (fromFName, toFName) {
369
+ if (isNullOrUndefined(fromFName) && isNullOrUndefined(toFName)) {
370
+ var error = 'The provided value for the fromFName and toFName is undefined. Please ensure the fromFName and toFName contains string.';
371
+ this.trigger(events.actionFailure, { error: error });
372
+ }
363
373
  this.grid.reorderColumns(fromFName, toFName);
364
374
  };
365
375
  TreeGrid.prototype.TreeGridLocale = function () {
366
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
367
- var locale = L10n.locale;
368
- var localeObject = {};
369
- setValue(this.locale, {}, localeObject);
370
- var gridLocale;
371
- gridLocale = {};
372
- gridLocale = getObject(this.locale, locale);
373
- var treeGridLocale;
374
- treeGridLocale = {};
375
- treeGridLocale = getObject(this.getModuleName(), gridLocale);
376
- setValue('grid', treeGridLocale, getObject(this.locale, localeObject));
377
- L10n.load(localeObject);
376
+ if (!isNullOrUndefined(this.locale)) {
377
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
378
+ var locale = L10n.locale;
379
+ var localeObject = {};
380
+ setValue(this.locale, {}, localeObject);
381
+ var gridLocale = void 0;
382
+ gridLocale = {};
383
+ gridLocale = getObject(this.locale, locale);
384
+ var treeGridLocale = void 0;
385
+ treeGridLocale = {};
386
+ treeGridLocale = getObject(this.getModuleName(), gridLocale);
387
+ setValue('grid', treeGridLocale, getObject(this.locale, localeObject));
388
+ L10n.load(localeObject);
389
+ }
378
390
  };
379
391
  /**
380
392
  * By default, prints all the pages of the TreeGrid and hides the pager.
@@ -421,45 +433,57 @@ var TreeGrid = /** @class */ (function (_super) {
421
433
  }
422
434
  break;
423
435
  case 'downArrow':
424
- if (!this.enableVirtualization) {
436
+ if (!this.enableVirtualization && isNullOrUndefined(this.rowTemplate)) {
425
437
  target = e.target;
426
- parentTarget = target.parentElement;
427
- if (!isNullOrUndefined(parentTarget)) {
428
- var cellIndex = parentTarget.cellIndex;
429
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
430
- parentTarget = target;
431
- }
432
- summaryElement = this.findnextRowElement(parentTarget);
433
- if (summaryElement !== null) {
434
- var cellIndex_1 = e.target.cellIndex;
435
- var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
436
- addClass([row_1], 'e-focused');
437
- addClass([row_1], 'e-focus');
438
- }
439
- else {
440
- this.clearSelection();
438
+ if (!isNullOrUndefined(target.querySelectorAll('.e-rowcell'))) {
439
+ target = parentsUntil(target, 'e-rowcell');
440
+ }
441
+ if (!isNullOrUndefined(target)) {
442
+ parentTarget = target.parentElement;
443
+ if (!isNullOrUndefined(parentTarget)) {
444
+ var cellIndex = parentTarget.cellIndex;
445
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
446
+ parentTarget = target;
447
+ }
448
+ summaryElement = this.findnextRowElement(parentTarget);
449
+ if (summaryElement !== null) {
450
+ var cellIndex_1 = target.cellIndex;
451
+ var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
452
+ addClass([row_1], 'e-focused');
453
+ addClass([row_1], 'e-focus');
454
+ }
455
+ else {
456
+ this.clearSelection();
457
+ }
441
458
  }
442
459
  }
443
460
  }
444
461
  break;
445
462
  case 'upArrow':
446
- if (!this.enableVirtualization) {
463
+ if (!this.enableVirtualization && isNullOrUndefined(this.rowTemplate)) {
447
464
  target = e.target;
448
- parentTarget = target.parentElement;
449
- if (!isNullOrUndefined(parentTarget)) {
450
- var cellIndex = parentTarget.cellIndex;
451
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
452
- parentTarget = target;
453
- }
454
- summaryElement = this.findPreviousRowElement(parentTarget);
455
- if (summaryElement !== null) {
456
- var cIndex = e.target.cellIndex;
457
- var rows = summaryElement.children[parseInt(cIndex.toString(), 10)];
458
- addClass([rows], 'e-focused');
459
- addClass([rows], 'e-focus');
460
- }
461
- else {
462
- this.clearSelection();
465
+ if (!isNullOrUndefined(target.querySelectorAll('.e-rowcell'))) {
466
+ target = parentsUntil(target, 'e-rowcell');
467
+ }
468
+ if (!isNullOrUndefined(target)) {
469
+ parentTarget = target.parentElement;
470
+ if (!isNullOrUndefined(parentTarget)) {
471
+ var cellIndex = parentTarget.cellIndex;
472
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
473
+ parentTarget = target;
474
+ }
475
+ summaryElement = this.findPreviousRowElement(parentTarget);
476
+ if (summaryElement !== null) {
477
+ var cellIndex_2 = target.cellIndex;
478
+ if (!isNullOrUndefined(cellIndex_2)) {
479
+ var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
480
+ addClass([row_2], 'e-focused');
481
+ addClass([row_2], 'e-focus');
482
+ }
483
+ }
484
+ else {
485
+ this.clearSelection();
486
+ }
463
487
  }
464
488
  }
465
489
  }
@@ -533,7 +557,9 @@ var TreeGrid = /** @class */ (function (_super) {
533
557
  TreeGrid.prototype.requiredModules = function () {
534
558
  var modules = [];
535
559
  var splitFrozenCount = 'splitFrozenCount';
536
- this.grid["" + splitFrozenCount](this.getColumns());
560
+ if (!this.isReact && isNullOrUndefined(this['changedProperties'].columns)) {
561
+ this.grid["" + splitFrozenCount](this.getColumns());
562
+ }
537
563
  if (this.isDestroyed) {
538
564
  return modules;
539
565
  }
@@ -653,7 +679,7 @@ var TreeGrid = /** @class */ (function (_super) {
653
679
  name: 'Edit'
654
680
  });
655
681
  }
656
- if (this.isCommandColumn(this.columns)) {
682
+ if (!isNullOrUndefined(this.columns) && this.isCommandColumn(this.columns)) {
657
683
  modules.push({
658
684
  member: 'commandColumn',
659
685
  args: [this],
@@ -786,6 +812,7 @@ var TreeGrid = /** @class */ (function (_super) {
786
812
  var root = 'root';
787
813
  this.grid["" + root] = this["" + root] ? this["" + root] : this;
788
814
  this.grid.appendTo(gridContainer);
815
+ this.actionFailureHandler();
789
816
  var gridContent = this.element.getElementsByClassName('e-gridcontent')[0].childNodes[0];
790
817
  gridContent.setAttribute('tabindex', '0');
791
818
  var contentTable = this.element.getElementsByClassName('e-content')[0].querySelector('.e-table');
@@ -808,6 +835,85 @@ var TreeGrid = /** @class */ (function (_super) {
808
835
  }
809
836
  };
810
837
  };
838
+ TreeGrid.prototype.actionFailureHandler = function () {
839
+ var _this = this;
840
+ var failureCases = [];
841
+ var primaryKeyFieldNames = this.getPrimaryKeyFieldNames();
842
+ var RecordsCount = this.flatData.length;
843
+ if ((this.editSettings.allowAdding || this.editSettings.allowDeleting || this.editSettings.allowEditing)
844
+ && primaryKeyFieldNames.length === 0 && RecordsCount !== 0) {
845
+ failureCases.push('For the CRUD actions, it is necessary to enable Primary Key field for the unique data column.');
846
+ }
847
+ if (this.allowRowDragAndDrop && primaryKeyFieldNames.length === 0 && RecordsCount !== 0) {
848
+ failureCases.push('For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column.');
849
+ }
850
+ if (this.allowPaging && this.enableVirtualization) {
851
+ failureCases.push('Paging is not allowed in virtualization case.');
852
+ }
853
+ if (RecordsCount === 0 && this.columns.length === 0) {
854
+ failureCases.push('Either of the Data source or columns should be given.');
855
+ }
856
+ if (this.frozenColumns > 0 && this.columnModel.filter(function (col) { return col.isFrozen; })) {
857
+ failureCases.push('Use only one attribute for Frozen either IsFrozen or FrozenColumns.');
858
+ }
859
+ if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
860
+ failureCases.push('Virtual scrolling is not compatible with the detail template');
861
+ }
862
+ if (this.stackedHeader && !isNullOrUndefined(this.detailTemplate)) {
863
+ failureCases.push('Virtual scrolling is not compatible with the detail template');
864
+ }
865
+ if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }) || this.frozenRows > 0)
866
+ && (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
867
+ failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
868
+ }
869
+ if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }).length > 0 || this.frozenRows > 0) && this.editSettings.mode === 'Cell') {
870
+ failureCases.push('Frozen rows and columns are not supported with cell editing.');
871
+ }
872
+ if (this.allowSelection && !isNullOrUndefined(this.rowTemplate)) {
873
+ failureCases.push('Selection is not supported in RowTemplate');
874
+ }
875
+ if (this.treeColumnIndex < 0) {
876
+ failureCases.push('For showing tree structure it is must to set the TreeColumnIndex value.');
877
+ }
878
+ if (this.treeColumnIndex >= this.columns.length) {
879
+ failureCases.push('TreeColumnIndex value should not exceed the total column count.');
880
+ }
881
+ if (this.enableVirtualization && (!/[0-9]$/.test(this.columnModel.filter(function (col) { return col.width; }).toString())
882
+ && !/[px]$/.test(this.columnModel.filter(function (col) { return col.width; }).toString()))
883
+ || (/[0-9]$/.test(this.height.toString()) && /[px]$/.test(this.height.toString()))) {
884
+ failureCases.push('column width and height should be in pixels');
885
+ }
886
+ if (!isNullOrUndefined(this.childMapping) && !isNullOrUndefined(this.idMapping)) {
887
+ failureCases.push('Both IdMapping and ChildMapping should not be used together for tree grid rendering.');
888
+ }
889
+ if ((!isNullOrUndefined(this.idMapping) && (isNullOrUndefined(this.parentIdMapping))) ||
890
+ ((isNullOrUndefined(this.idMapping) && (!isNullOrUndefined(this.parentIdMapping))))) {
891
+ failureCases.push('IdMapping and ParentIdMapping properties should be defined and vice versa.');
892
+ }
893
+ var checkboxColumn = this.columnModel.filter(function (col) { return col.showCheckbox; });
894
+ var treeColumn = this.columns[this.treeColumnIndex];
895
+ if (checkboxColumn.length !== 0) {
896
+ if (checkboxColumn !== treeColumn) {
897
+ failureCases.push('ShowCheckbox column should not be defined other than the tree column.');
898
+ }
899
+ if (checkboxColumn.length > 1) {
900
+ failureCases.push('Only one column can have the ShowCheckbox option enabled.');
901
+ }
902
+ }
903
+ var alignColumn = this.columnModel.filter(function (col) { return col.textAlign === 'Right' && col.field === _this.columnModel[_this.treeColumnIndex].field; });
904
+ if (alignColumn.length !== 0) {
905
+ failureCases.push('TextAlign right for the tree column is not applicable.');
906
+ }
907
+ if (failureCases.length > 0) {
908
+ var failureEventArgs_1 = {
909
+ error: {}
910
+ };
911
+ failureCases.forEach(function (failureCase, index) {
912
+ failureEventArgs_1.error[parseInt(index.toString(), 10)] = failureCase;
913
+ });
914
+ this.trigger(events.actionFailure, failureEventArgs_1);
915
+ }
916
+ };
811
917
  TreeGrid.prototype.refreshToolbarItems = function () {
812
918
  var toolbarElement = this.toolbarModule.getToolbar();
813
919
  var indentID = this.element.id + '_gridcontrol_indent';
@@ -1019,7 +1125,9 @@ var TreeGrid = /** @class */ (function (_super) {
1019
1125
  }
1020
1126
  };
1021
1127
  this.grid.printComplete = this.triggerEvents.bind(this);
1022
- this.grid.actionFailure = this.triggerEvents.bind(this);
1128
+ this.grid.actionFailure = function (args) {
1129
+ _this.trigger(events.actionFailure, args);
1130
+ };
1023
1131
  this.extendedGridDataBoundEvent();
1024
1132
  this.extendedGridEvents();
1025
1133
  this.extendedGridActionEvents();
@@ -1696,6 +1804,11 @@ var TreeGrid = /** @class */ (function (_super) {
1696
1804
  TreeGrid.prototype.onPropertyChanged = function (newProp) {
1697
1805
  var properties = Object.keys(newProp);
1698
1806
  var requireRefresh = false;
1807
+ if (properties.indexOf('columns') > -1) {
1808
+ this.grid.columns = this.getGridColumns(newProp.columns);
1809
+ this.grid['updateColumnObject']();
1810
+ requireRefresh = true;
1811
+ }
1699
1812
  for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {
1700
1813
  var prop = properties_1[_i];
1701
1814
  switch (prop) {
@@ -2132,6 +2245,10 @@ var TreeGrid = /** @class */ (function (_super) {
2132
2245
  * @returns {void}
2133
2246
  */
2134
2247
  TreeGrid.prototype.deleteRecord = function (fieldName, data) {
2248
+ if ((isNullOrUndefined(fieldName) && (isNullOrUndefined(data)) || (this.getSelectedRecords().length <= 0))) {
2249
+ var error = 'The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number.';
2250
+ this.trigger(events.actionFailure, { error: error });
2251
+ }
2135
2252
  if (this.grid.editModule) {
2136
2253
  this.grid.editModule.deleteRecord(fieldName, data);
2137
2254
  }
@@ -2200,6 +2317,10 @@ var TreeGrid = /** @class */ (function (_super) {
2200
2317
  * @returns {void}
2201
2318
  */
2202
2319
  TreeGrid.prototype.deleteRow = function (tr) {
2320
+ if (isNullOrUndefined(tr)) {
2321
+ var error = 'The provided value for the tr is undefined. Please ensure the tr contains HTMLTableRowElement.';
2322
+ this.trigger(events.actionFailure, { error: error });
2323
+ }
2203
2324
  if (this.grid.editModule) {
2204
2325
  this.grid.editModule.deleteRow(tr);
2205
2326
  }
@@ -2225,9 +2346,11 @@ var TreeGrid = /** @class */ (function (_super) {
2225
2346
  this.grid.setCellValue(key, field, value);
2226
2347
  var rowIndex = this.grid.getRowIndexByPrimaryKey(key);
2227
2348
  var record = this.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
2228
- if (!isNullOrUndefined(record)) {
2229
- editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
2349
+ if (isNullOrUndefined(record)) {
2350
+ var error = 'The provided value for the record is undefined. Please ensure the record contains ITreeData.';
2351
+ this.trigger(events.actionFailure, { error: error });
2230
2352
  }
2353
+ editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
2231
2354
  };
2232
2355
  /**
2233
2356
  * Updates and refresh the particular row values based on the given primary key value.
@@ -2278,6 +2401,10 @@ var TreeGrid = /** @class */ (function (_super) {
2278
2401
  * @returns {void}
2279
2402
  */
2280
2403
  TreeGrid.prototype.goToPage = function (pageNo) {
2404
+ if (isNullOrUndefined(pageNo)) {
2405
+ var error = 'The provided value for the pageNo is undefined. Please ensure the pageNo contains number.';
2406
+ this.trigger(events.actionFailure, { error: error });
2407
+ }
2281
2408
  if (this.grid.pagerModule) {
2282
2409
  this.grid.pagerModule.goToPage(pageNo);
2283
2410
  }
@@ -2379,6 +2506,10 @@ var TreeGrid = /** @class */ (function (_super) {
2379
2506
  * @returns {void}
2380
2507
  */
2381
2508
  TreeGrid.prototype.hideColumns = function (keys, hideBy) {
2509
+ if (isNullOrUndefined(keys)) {
2510
+ var error = 'The provided value for the keys is undefined. Please ensure the keys contains string.';
2511
+ this.trigger(events.actionFailure, { error: error });
2512
+ }
2382
2513
  this.grid.hideColumns(keys, hideBy);
2383
2514
  this.updateColumnModel();
2384
2515
  };
@@ -2476,10 +2607,10 @@ var TreeGrid = /** @class */ (function (_super) {
2476
2607
  if (this.grid.columns.length !== this.columnModel.length) {
2477
2608
  this.stackedHeader = true;
2478
2609
  }
2479
- if (this.stackedHeader && this.allowResizing) {
2610
+ if (this.stackedHeader && this.allowResizing && !isNullOrUndefined(this.columns)) {
2480
2611
  this.updateColumnsWidth(this.columns);
2481
2612
  }
2482
- if (!this.stackedHeader) {
2613
+ if (!this.stackedHeader && !isNullOrUndefined(this.columns)) {
2483
2614
  merge(this.columns, this.columnModel);
2484
2615
  }
2485
2616
  this["" + deepMerge] = undefined; // Workaround for blazor updateModel
@@ -2488,10 +2619,10 @@ var TreeGrid = /** @class */ (function (_super) {
2488
2619
  TreeGrid.prototype.updateColumnsWidth = function (columns) {
2489
2620
  var _this = this;
2490
2621
  columns.forEach(function (column) {
2491
- if (column.columns) {
2622
+ if (!isNullOrUndefined(column) && column.columns) {
2492
2623
  _this.updateColumnsWidth(column.columns);
2493
2624
  }
2494
- else if (column.field) {
2625
+ else if (!isNullOrUndefined(column) && column.field) {
2495
2626
  var currentColumn = _this.grid.getColumnByField(column.field);
2496
2627
  if (!isNullOrUndefined(currentColumn)) {
2497
2628
  column.width = currentColumn.width;
@@ -2796,6 +2927,10 @@ var TreeGrid = /** @class */ (function (_super) {
2796
2927
  */
2797
2928
  TreeGrid.prototype.expandRow = function (row, record, key, level) {
2798
2929
  var _this = this;
2930
+ if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key) && isNullOrUndefined(level)) {
2931
+ var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
2932
+ this.trigger(events.actionFailure, { error: error });
2933
+ }
2799
2934
  var parentRec = this.parentData;
2800
2935
  if (!this.enableVirtualization) {
2801
2936
  parentRec = this.flatData.filter(function (e) {
@@ -2819,13 +2954,13 @@ var TreeGrid = /** @class */ (function (_super) {
2819
2954
  if (expandingArgs.expandAll) {
2820
2955
  _this.expandCollapseAllChildren(record, 'expand', key, level);
2821
2956
  }
2822
- _this.expandRows(row, record, parentRec, key, level);
2957
+ _this.expandRows(row, record, parentRec);
2823
2958
  }
2824
2959
  });
2825
2960
  }
2826
2961
  else if ((!this.allowPaging || (pagerValuePresent && this.grid.pagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === 'All')) &&
2827
2962
  !this.expandAllPrevent && this.isExpandingEventTriggered) {
2828
- this.expandRows(row, record, parentRec, key, level);
2963
+ this.expandRows(row, record, parentRec);
2829
2964
  }
2830
2965
  this.isExpandingEventTriggered = true;
2831
2966
  }
@@ -2836,13 +2971,13 @@ var TreeGrid = /** @class */ (function (_super) {
2836
2971
  if (expandingArgs.expandAll) {
2837
2972
  _this.expandCollapseAllChildren(record, 'expand', key, level);
2838
2973
  }
2839
- _this.expandRows(row, record, parentRec, key, level);
2974
+ _this.expandRows(row, record, parentRec);
2840
2975
  }
2841
2976
  });
2842
2977
  }
2843
2978
  };
2844
2979
  // Internal method to handle the rows expand
2845
- TreeGrid.prototype.expandRows = function (row, record, parentRec, key, level) {
2980
+ TreeGrid.prototype.expandRows = function (row, record, parentRec) {
2846
2981
  this.expandCollapse('expand', row, record);
2847
2982
  var children = 'Children';
2848
2983
  if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record["" + children]))) {
@@ -2913,6 +3048,10 @@ var TreeGrid = /** @class */ (function (_super) {
2913
3048
  */
2914
3049
  TreeGrid.prototype.collapseRow = function (row, record, key) {
2915
3050
  var _this = this;
3051
+ if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key)) {
3052
+ var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
3053
+ this.trigger(events.actionFailure, { error: error });
3054
+ }
2916
3055
  var parentRec = this.parentData;
2917
3056
  if (!this.enableVirtualization) {
2918
3057
  parentRec = this.flatData.filter(function (e) {
@@ -2929,12 +3068,12 @@ var TreeGrid = /** @class */ (function (_super) {
2929
3068
  if (collapsingArgs.collapseAll) {
2930
3069
  _this.expandCollapseAllChildren(record, 'collapse', key);
2931
3070
  }
2932
- _this.collapseRows(row, record, parentRec, key);
3071
+ _this.collapseRows(row, record, parentRec);
2933
3072
  }
2934
3073
  });
2935
3074
  }
2936
3075
  else if (!this.allowPaging && !this.collapseAllPrevent && this.isCollapsingEventTriggered) {
2937
- this.collapseRows(row, record, parentRec, key);
3076
+ this.collapseRows(row, record, parentRec);
2938
3077
  }
2939
3078
  this.isCollapsingEventTriggered = true;
2940
3079
  }
@@ -2942,13 +3081,13 @@ var TreeGrid = /** @class */ (function (_super) {
2942
3081
  var args = { data: record, row: row, cancel: false };
2943
3082
  this.trigger(events.collapsing, args, function (collapsingArgs) {
2944
3083
  if (!collapsingArgs.cancel && !isNullOrUndefined(record)) {
2945
- _this.collapseRows(row, record, parentRec, key);
3084
+ _this.collapseRows(row, record, parentRec);
2946
3085
  }
2947
3086
  });
2948
3087
  }
2949
3088
  };
2950
3089
  // Internal method for handling the rows collapse
2951
- TreeGrid.prototype.collapseRows = function (row, record, parentRec, key) {
3090
+ TreeGrid.prototype.collapseRows = function (row, record, parentRec) {
2952
3091
  this.expandCollapse('collapse', row, record);
2953
3092
  var collapseArgs = { data: record, row: row };
2954
3093
  if (!isRemoteData(this)) {
@@ -2992,6 +3131,10 @@ var TreeGrid = /** @class */ (function (_super) {
2992
3131
  * @returns {void}
2993
3132
  */
2994
3133
  TreeGrid.prototype.expandAtLevel = function (level) {
3134
+ if (isNullOrUndefined(level)) {
3135
+ var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
3136
+ this.trigger(events.actionFailure, { error: error });
3137
+ }
2995
3138
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
2996
3139
  var rec = this.grid.dataSource.filter(function (e) {
2997
3140
  if (e.hasChildRecords && e.level === level) {
@@ -3014,6 +3157,10 @@ var TreeGrid = /** @class */ (function (_super) {
3014
3157
  * @returns {void}
3015
3158
  */
3016
3159
  TreeGrid.prototype.expandByKey = function (key) {
3160
+ if (isNullOrUndefined(key)) {
3161
+ var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
3162
+ this.trigger(events.actionFailure, { error: error });
3163
+ }
3017
3164
  this.expandCollapseActionByKey(key, 'Expand');
3018
3165
  };
3019
3166
  TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
@@ -3071,6 +3218,10 @@ var TreeGrid = /** @class */ (function (_super) {
3071
3218
  * @returns {void}
3072
3219
  */
3073
3220
  TreeGrid.prototype.collapseAtLevel = function (level) {
3221
+ if (isNullOrUndefined(level)) {
3222
+ var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
3223
+ this.trigger(events.actionFailure, { error: error });
3224
+ }
3074
3225
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
3075
3226
  var record = this.grid.dataSource.filter(function (e) {
3076
3227
  if (e.hasChildRecords && e.level === level) {
@@ -3093,6 +3244,10 @@ var TreeGrid = /** @class */ (function (_super) {
3093
3244
  * @returns {void}
3094
3245
  */
3095
3246
  TreeGrid.prototype.collapseByKey = function (key) {
3247
+ if (isNullOrUndefined(key)) {
3248
+ var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
3249
+ this.trigger(events.actionFailure, { error: error });
3250
+ }
3096
3251
  this.expandCollapseActionByKey(key, 'Collapse');
3097
3252
  };
3098
3253
  TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {
@@ -3133,6 +3288,10 @@ var TreeGrid = /** @class */ (function (_super) {
3133
3288
  * @returns {void}
3134
3289
  */
3135
3290
  TreeGrid.prototype.expandAll = function () {
3291
+ if (this.getCurrentViewRecords().length === 0) {
3292
+ var error = 'The provided value for the datasource is undefined. Please ensure to add the dataSource.';
3293
+ this.trigger(events.actionFailure, { error: error });
3294
+ }
3136
3295
  this.isExpandedEventTriggered = false;
3137
3296
  this.isExpandingEventTriggered = false;
3138
3297
  this.expandCollapseAll('expand');
@@ -3143,6 +3302,10 @@ var TreeGrid = /** @class */ (function (_super) {
3143
3302
  * @returns {void}
3144
3303
  */
3145
3304
  TreeGrid.prototype.collapseAll = function () {
3305
+ if (this.getCurrentViewRecords().length === 0) {
3306
+ var error = 'The provided value for the datasource is undefined. Please ensure to add the dataSource.';
3307
+ this.trigger(events.actionFailure, { error: error });
3308
+ }
3146
3309
  this.isCollapsedEventTriggered = false;
3147
3310
  this.isCollapsingEventTriggered = false;
3148
3311
  this.expandCollapseAll('collapse');
@@ -3702,6 +3865,10 @@ var TreeGrid = /** @class */ (function (_super) {
3702
3865
  * @returns {void}
3703
3866
  */
3704
3867
  TreeGrid.prototype.filterByColumn = function (fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {
3868
+ if (isNullOrUndefined(fieldName) && isNullOrUndefined(filterOperator) && isNullOrUndefined(filterValue)) {
3869
+ var error = 'The provided value for the fieldName, filterOperator and filterValue are undefined. Please ensure the fieldName, filterOperator and filterValue.';
3870
+ this.trigger(events.actionFailure, { error: error });
3871
+ }
3705
3872
  this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);
3706
3873
  };
3707
3874
  /**
@@ -3768,6 +3935,10 @@ var TreeGrid = /** @class */ (function (_super) {
3768
3935
  * @returns {void}
3769
3936
  */
3770
3937
  TreeGrid.prototype.paste = function (data, rowIndex, colIndex) {
3938
+ if (isNullOrUndefined(data) && isNullOrUndefined(rowIndex) && isNullOrUndefined(colIndex)) {
3939
+ var error = 'The provided value for the index is undefined. Please ensure the index contains number.';
3940
+ this.trigger(events.actionFailure, { error: error });
3941
+ }
3771
3942
  this.clipboardModule.paste(data, rowIndex, colIndex);
3772
3943
  };
3773
3944
  /**
@@ -3979,7 +4150,7 @@ var TreeGrid = /** @class */ (function (_super) {
3979
4150
  * @returns {number} - Returns frozen column count
3980
4151
  */
3981
4152
  TreeGrid.prototype.getFrozenColumns = function () {
3982
- return this.getFrozenCount(this.columns, 0) + this.frozenColumns;
4153
+ return this.getFrozenCount(!isNullOrUndefined(this.columns) && this.columns, 0) + this.frozenColumns;
3983
4154
  };
3984
4155
  TreeGrid.prototype.getFrozenCount = function (cols, cnt) {
3985
4156
  for (var j = 0, len = cols.length; j < len; j++) {
@@ -4036,6 +4207,10 @@ var TreeGrid = /** @class */ (function (_super) {
4036
4207
  * @returns {void}
4037
4208
  */
4038
4209
  TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {
4210
+ if (isNullOrUndefined(fromIndexes) && isNullOrUndefined(toIndex) && isNullOrUndefined(position)) {
4211
+ var error = 'The provided value for the fromIndexes, toIndex and position is undefined. Please ensure the fromIndexes and toIndex contains number and position contains string.';
4212
+ this.trigger(events.actionFailure, { error: error });
4213
+ }
4039
4214
  this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);
4040
4215
  };
4041
4216
  /**
@@ -70,8 +70,8 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
70
70
  var rows = _super.prototype.generateRows.call(this, data, notifyArgs);
71
71
  if (!isNullOrUndefined((this.visualData))) {
72
72
  for (var r = 0; r < rows.length; r++) {
73
- rows[parseInt(r.toString(), 10)].index =
74
- (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
73
+ rows[parseInt(r.toString(), 10)].index
74
+ = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
75
75
  }
76
76
  }
77
77
  return rows;
@@ -52,6 +52,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
52
52
  VirtualTreeContentRenderer.prototype.getFrozenRightVirtualRowByIndex = function (index) {
53
53
  return this.getRowCollection(index, false, false, true);
54
54
  };
55
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
55
56
  VirtualTreeContentRenderer.prototype.getRowCollection = function (index, isMovable, isRowObject, isFrozenRight) {
56
57
  var startIdx = parseInt(this.parent.getRows()[0].getAttribute(literals.dataRowIndex), 10);
57
58
  var rowCollection = this.parent.getDataRows();
@@ -218,6 +219,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
218
219
  VirtualTreeContentRenderer.prototype.rowSelectedEvent = function (args) {
219
220
  var rowSelected = 'rowSelected';
220
221
  _super.prototype["" + rowSelected].call(this, args);
222
+ this.parent.notify('virtualTransform', { requestType: 'transformChange' });
221
223
  };
222
224
  VirtualTreeContentRenderer.prototype.toSelectVirtualRow = function (args) {
223
225
  if (this.parent.isEdit) {
@@ -387,7 +389,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
387
389
  var outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
388
390
  var content = this.parent.getContent().querySelector('.e-content');
389
391
  var scrollHeight = outBuffer * rowHeight;
390
- var upScroll = (scrollArgs.offset.top - this.translateY) < 0;
392
+ var upScroll = (scrollArgs.offset.top - this.translateY) <= 0;
391
393
  var downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) + rowHeight >= scrollHeight;
392
394
  var selectedRowIndex = 'selectedRowIndex';
393
395
  var currentViewData = this.parent.currentViewData;
@@ -399,7 +401,8 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
399
401
  + Math.ceil(vHeight / rowHeight))
400
402
  - this.parent.pageSettings.pageSize;
401
403
  index = (index > 0) ? index : 0;
402
- if (!isNullOrUndefined(this["" + selectedRowIndex]) && this["" + selectedRowIndex] !== -1 && index !== this["" + selectedRowIndex]) {
404
+ if (!isNullOrUndefined(this["" + selectedRowIndex]) && this["" + selectedRowIndex] !== -1 && index !== this["" + selectedRowIndex] &&
405
+ ((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop)) {
403
406
  index = this["" + selectedRowIndex];
404
407
  }
405
408
  this.startIndex = index;
@@ -489,10 +492,10 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
489
492
  this.previousInfo = viewInfo;
490
493
  this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
491
494
  var page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
495
+ this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
492
496
  if (downScroll && this.endIndex === this.totalRecords && viewInfo.loadNext) {
493
497
  viewInfo.loadNext = false;
494
498
  }
495
- this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
496
499
  this.requestType = 'virtualscroll';
497
500
  if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
498
501
  viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;