@syncfusion/ej2-treegrid 25.2.6 → 26.1.35-760834

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 (231) hide show
  1. package/.eslintrc.json +243 -259
  2. package/README.md +83 -83
  3. package/dist/ej2-treegrid.min.js +1 -10
  4. package/dist/ej2-treegrid.umd.min.js +1 -10
  5. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es2015.js +842 -553
  7. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  8. package/dist/es6/ej2-treegrid.es5.js +1361 -1069
  9. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  10. package/dist/global/ej2-treegrid.min.js +1 -10
  11. package/dist/global/ej2-treegrid.min.js.map +1 -1
  12. package/dist/global/index.d.ts +0 -9
  13. package/dist/ts/undefined +73 -0
  14. package/license +9 -9
  15. package/package.json +70 -70
  16. package/src/treegrid/actions/clipboard.js +13 -13
  17. package/src/treegrid/actions/crud-actions.js +1 -1
  18. package/src/treegrid/actions/edit.js +11 -9
  19. package/src/treegrid/actions/excel-export.js +16 -4
  20. package/src/treegrid/actions/logger.js +13 -13
  21. package/src/treegrid/actions/page.js +4 -0
  22. package/src/treegrid/actions/rowdragdrop.js +27 -16
  23. package/src/treegrid/actions/selection.js +13 -1
  24. package/src/treegrid/actions/virtual-scroll.d.ts +2 -0
  25. package/src/treegrid/actions/virtual-scroll.js +26 -14
  26. package/src/treegrid/base/constant.d.ts +2 -0
  27. package/src/treegrid/base/constant.js +2 -0
  28. package/src/treegrid/base/data.js +22 -4
  29. package/src/treegrid/base/interface.js +0 -1
  30. package/src/treegrid/base/treegrid-model.d.ts +875 -875
  31. package/src/treegrid/base/treegrid.d.ts +45 -41
  32. package/src/treegrid/base/treegrid.js +338 -101
  33. package/src/treegrid/models/column-model.d.ts +6 -6
  34. package/src/treegrid/models/column.js +19 -19
  35. package/src/treegrid/models/edit-settings-model.d.ts +72 -72
  36. package/src/treegrid/models/edit-settings.js +19 -19
  37. package/src/treegrid/models/filter-settings-model.d.ts +206 -206
  38. package/src/treegrid/models/filter-settings.js +19 -19
  39. package/src/treegrid/models/infinite-scroll-settings-model.d.ts +16 -16
  40. package/src/treegrid/models/infinite-scroll-settings.js +19 -19
  41. package/src/treegrid/models/loading-indicator.js +19 -19
  42. package/src/treegrid/models/page-settings-model.d.ts +46 -46
  43. package/src/treegrid/models/page-settings.js +19 -19
  44. package/src/treegrid/models/rowdrop-settings-model.d.ts +6 -6
  45. package/src/treegrid/models/rowdrop-settings.js +19 -19
  46. package/src/treegrid/models/search-settings-model.d.ts +60 -60
  47. package/src/treegrid/models/search-settings.js +19 -19
  48. package/src/treegrid/models/selection-settings-model.d.ts +66 -66
  49. package/src/treegrid/models/selection-settings.js +19 -19
  50. package/src/treegrid/models/sort-settings-model.d.ts +24 -24
  51. package/src/treegrid/models/sort-settings.js +19 -19
  52. package/src/treegrid/models/summary-model.d.ts +64 -64
  53. package/src/treegrid/models/summary.js +19 -19
  54. package/src/treegrid/models/textwrap-settings-model.d.ts +9 -9
  55. package/src/treegrid/models/textwrap-settings.js +19 -19
  56. package/src/treegrid/renderer/virtual-row-model-generator.js +15 -15
  57. package/src/treegrid/renderer/virtual-tree-content-render.js +26 -20
  58. package/styles/bds-lite.css +745 -0
  59. package/styles/bds-lite.scss +18 -0
  60. package/styles/bds.css +765 -0
  61. package/styles/bds.scss +19 -0
  62. package/styles/bootstrap-dark-lite.css +506 -0
  63. package/styles/bootstrap-dark-lite.scss +18 -0
  64. package/styles/bootstrap-dark.css +187 -117
  65. package/styles/bootstrap-dark.scss +19 -1
  66. package/styles/bootstrap-lite.css +509 -0
  67. package/styles/bootstrap-lite.scss +18 -0
  68. package/styles/bootstrap.css +190 -121
  69. package/styles/bootstrap.scss +19 -1
  70. package/styles/bootstrap4-lite.css +550 -0
  71. package/styles/bootstrap4-lite.scss +18 -0
  72. package/styles/bootstrap4.css +194 -133
  73. package/styles/bootstrap4.scss +19 -1
  74. package/styles/bootstrap5-dark-lite.css +545 -0
  75. package/styles/bootstrap5-dark-lite.scss +18 -0
  76. package/styles/bootstrap5-dark.css +189 -123
  77. package/styles/bootstrap5-dark.scss +19 -1
  78. package/styles/bootstrap5-lite.css +545 -0
  79. package/styles/bootstrap5-lite.scss +18 -0
  80. package/styles/bootstrap5.3-lite.css +549 -0
  81. package/styles/bootstrap5.3-lite.scss +18 -0
  82. package/styles/bootstrap5.3.css +569 -0
  83. package/styles/bootstrap5.3.scss +19 -0
  84. package/styles/bootstrap5.css +188 -122
  85. package/styles/bootstrap5.scss +19 -1
  86. package/styles/fabric-dark-lite.css +485 -0
  87. package/styles/fabric-dark-lite.scss +18 -0
  88. package/styles/fabric-dark.css +188 -118
  89. package/styles/fabric-dark.scss +19 -1
  90. package/styles/fabric-lite.css +485 -0
  91. package/styles/fabric-lite.scss +18 -0
  92. package/styles/fabric.css +188 -111
  93. package/styles/fabric.scss +19 -1
  94. package/styles/fluent-dark-lite.css +548 -0
  95. package/styles/fluent-dark-lite.scss +18 -0
  96. package/styles/fluent-dark.css +195 -116
  97. package/styles/fluent-dark.scss +19 -1
  98. package/styles/fluent-lite.css +548 -0
  99. package/styles/fluent-lite.scss +18 -0
  100. package/styles/fluent.css +195 -116
  101. package/styles/fluent.scss +19 -1
  102. package/styles/fluent2-lite.css +735 -0
  103. package/styles/fluent2-lite.scss +18 -0
  104. package/styles/fluent2.css +758 -0
  105. package/styles/fluent2.scss +19 -0
  106. package/styles/highcontrast-light-lite.css +491 -0
  107. package/styles/highcontrast-light-lite.scss +18 -0
  108. package/styles/highcontrast-light.css +185 -103
  109. package/styles/highcontrast-light.scss +19 -1
  110. package/styles/highcontrast-lite.css +498 -0
  111. package/styles/highcontrast-lite.scss +18 -0
  112. package/styles/highcontrast.css +196 -107
  113. package/styles/highcontrast.scss +19 -1
  114. package/styles/material-dark-lite.css +567 -0
  115. package/styles/material-dark-lite.scss +18 -0
  116. package/styles/material-dark.css +220 -105
  117. package/styles/material-dark.scss +19 -1
  118. package/styles/material-lite.css +591 -0
  119. package/styles/material-lite.scss +18 -0
  120. package/styles/material.css +234 -129
  121. package/styles/material.scss +19 -1
  122. package/styles/material3-dark-lite.css +578 -0
  123. package/styles/material3-dark-lite.scss +18 -0
  124. package/styles/material3-dark.css +220 -185
  125. package/styles/material3-dark.scss +19 -1
  126. package/styles/material3-lite.css +580 -0
  127. package/styles/material3-lite.scss +18 -0
  128. package/styles/material3.css +221 -240
  129. package/styles/material3.scss +19 -1
  130. package/styles/tailwind-dark-lite.css +518 -0
  131. package/styles/tailwind-dark-lite.scss +18 -0
  132. package/styles/tailwind-dark.css +196 -103
  133. package/styles/tailwind-dark.scss +19 -1
  134. package/styles/tailwind-lite.css +518 -0
  135. package/styles/tailwind-lite.scss +18 -0
  136. package/styles/tailwind.css +196 -103
  137. package/styles/tailwind.scss +19 -1
  138. package/styles/tailwind3-lite.css +561 -0
  139. package/styles/tailwind3-lite.scss +18 -0
  140. package/styles/tailwind3.css +581 -0
  141. package/styles/tailwind3.scss +19 -0
  142. package/styles/treegrid/_all.scss +2 -2
  143. package/styles/treegrid/_bds-definition.scss +24 -28
  144. package/styles/treegrid/_bigger.scss +66 -0
  145. package/styles/treegrid/_bootstrap-dark-definition.scss +29 -30
  146. package/styles/treegrid/_bootstrap-definition.scss +29 -30
  147. package/styles/treegrid/_bootstrap4-definition.scss +29 -30
  148. package/styles/treegrid/_bootstrap5-definition.scss +24 -28
  149. package/styles/treegrid/_bootstrap5.3-definition.scss +24 -0
  150. package/styles/treegrid/_fabric-dark-definition.scss +29 -30
  151. package/styles/treegrid/_fabric-definition.scss +29 -30
  152. package/styles/treegrid/_fluent-definition.scss +25 -29
  153. package/styles/treegrid/_fluent2-definition.scss +24 -0
  154. package/styles/treegrid/_fusionnew-definition.scss +24 -28
  155. package/styles/treegrid/_highcontrast-definition.scss +29 -30
  156. package/styles/treegrid/_highcontrast-light-definition.scss +29 -30
  157. package/styles/treegrid/_icons.scss +47 -37
  158. package/styles/treegrid/_layout.scss +530 -455
  159. package/styles/treegrid/_material-dark-definition.scss +29 -30
  160. package/styles/treegrid/_material-definition.scss +29 -30
  161. package/styles/treegrid/_material3-definition.scss +24 -28
  162. package/styles/treegrid/_tailwind-definition.scss +24 -28
  163. package/styles/treegrid/_tailwind3-definition.scss +24 -0
  164. package/styles/treegrid/_theme.scss +1 -1
  165. package/styles/treegrid/bds.css +765 -0
  166. package/styles/treegrid/bds.scss +19 -0
  167. package/styles/treegrid/bootstrap-dark.css +187 -117
  168. package/styles/treegrid/bootstrap-dark.scss +1 -0
  169. package/styles/treegrid/bootstrap.css +190 -121
  170. package/styles/treegrid/bootstrap.scss +1 -0
  171. package/styles/treegrid/bootstrap4.css +194 -133
  172. package/styles/treegrid/bootstrap4.scss +1 -0
  173. package/styles/treegrid/bootstrap5-dark.css +189 -123
  174. package/styles/treegrid/bootstrap5-dark.scss +1 -0
  175. package/styles/treegrid/bootstrap5.3.css +569 -0
  176. package/styles/treegrid/bootstrap5.3.scss +19 -0
  177. package/styles/treegrid/bootstrap5.css +188 -122
  178. package/styles/treegrid/bootstrap5.scss +1 -0
  179. package/styles/treegrid/fabric-dark.css +188 -118
  180. package/styles/treegrid/fabric-dark.scss +1 -0
  181. package/styles/treegrid/fabric.css +188 -111
  182. package/styles/treegrid/fabric.scss +1 -0
  183. package/styles/treegrid/fluent-dark.css +195 -116
  184. package/styles/treegrid/fluent-dark.scss +1 -0
  185. package/styles/treegrid/fluent.css +195 -116
  186. package/styles/treegrid/fluent.scss +1 -0
  187. package/styles/treegrid/fluent2.css +758 -0
  188. package/styles/treegrid/fluent2.scss +19 -0
  189. package/styles/treegrid/highcontrast-light.css +185 -103
  190. package/styles/treegrid/highcontrast-light.scss +1 -0
  191. package/styles/treegrid/highcontrast.css +196 -107
  192. package/styles/treegrid/highcontrast.scss +1 -0
  193. package/styles/treegrid/icons/_bds.scss +37 -37
  194. package/styles/treegrid/icons/_bootstrap-dark.scss +47 -37
  195. package/styles/treegrid/icons/_bootstrap.scss +47 -37
  196. package/styles/treegrid/icons/_bootstrap4.scss +47 -37
  197. package/styles/treegrid/icons/_bootstrap5.3.scss +47 -0
  198. package/styles/treegrid/icons/_bootstrap5.scss +47 -37
  199. package/styles/treegrid/icons/_fabric-dark.scss +47 -37
  200. package/styles/treegrid/icons/_fabric.scss +47 -37
  201. package/styles/treegrid/icons/_fluent.scss +47 -37
  202. package/styles/treegrid/icons/_fluent2.scss +47 -0
  203. package/styles/treegrid/icons/_fusionnew.scss +30 -26
  204. package/styles/treegrid/icons/_highcontrast-light.scss +47 -37
  205. package/styles/treegrid/icons/_highcontrast.scss +47 -37
  206. package/styles/treegrid/icons/_material-dark.scss +47 -37
  207. package/styles/treegrid/icons/_material.scss +47 -37
  208. package/styles/treegrid/icons/_material3.scss +47 -37
  209. package/styles/treegrid/icons/_tailwind-dark.scss +47 -37
  210. package/styles/treegrid/icons/_tailwind.scss +47 -37
  211. package/styles/treegrid/icons/_tailwind3.scss +47 -0
  212. package/styles/treegrid/material-dark.css +220 -105
  213. package/styles/treegrid/material-dark.scss +1 -0
  214. package/styles/treegrid/material.css +234 -129
  215. package/styles/treegrid/material.scss +1 -0
  216. package/styles/treegrid/material3-dark.css +220 -185
  217. package/styles/treegrid/material3-dark.scss +2 -1
  218. package/styles/treegrid/material3.css +221 -240
  219. package/styles/treegrid/material3.scss +2 -1
  220. package/styles/treegrid/tailwind-dark.css +196 -103
  221. package/styles/treegrid/tailwind-dark.scss +1 -0
  222. package/styles/treegrid/tailwind.css +196 -103
  223. package/styles/treegrid/tailwind.scss +1 -0
  224. package/styles/treegrid/tailwind3.css +581 -0
  225. package/styles/treegrid/tailwind3.scss +19 -0
  226. package/CHANGELOG.md +0 -264
  227. package/helpers/e2e/index.d.ts +0 -1
  228. package/helpers/e2e/index.js +0 -8
  229. package/helpers/e2e/treegridhelper.d.ts +0 -21
  230. package/helpers/e2e/treegridhelper.js +0 -83
  231. package/tslint.json +0 -111
@@ -1,29 +1,29 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- };
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
19
+ };
20
20
  import { Component, addClass, createElement, EventHandler, isNullOrUndefined, extend, merge, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
21
21
  import { removeClass, Complex, Collection, getValue } from '@syncfusion/ej2-base';
22
22
  import { Event, Property, NotifyPropertyChanges, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';
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,61 @@ 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
+ if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
453
+ addClass([row_1], 'e-focused');
454
+ addClass([row_1], 'e-focus');
455
+ }
456
+ }
457
+ else {
458
+ this.clearSelection();
459
+ }
441
460
  }
442
461
  }
443
462
  }
444
463
  break;
445
464
  case 'upArrow':
446
- if (!this.enableVirtualization) {
465
+ if (!this.enableVirtualization && isNullOrUndefined(this.rowTemplate)) {
447
466
  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();
467
+ if (!isNullOrUndefined(target.querySelectorAll('.e-rowcell'))) {
468
+ target = parentsUntil(target, 'e-rowcell');
469
+ }
470
+ if (!isNullOrUndefined(target)) {
471
+ parentTarget = target.parentElement;
472
+ if (!isNullOrUndefined(parentTarget)) {
473
+ var cellIndex = parentTarget.cellIndex;
474
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
475
+ parentTarget = target;
476
+ }
477
+ summaryElement = this.findPreviousRowElement(parentTarget);
478
+ if (summaryElement !== null) {
479
+ var cellIndex_2 = target.cellIndex;
480
+ if (!isNullOrUndefined(cellIndex_2)) {
481
+ var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
482
+ if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
483
+ addClass([row_2], 'e-focused');
484
+ addClass([row_2], 'e-focus');
485
+ }
486
+ }
487
+ }
488
+ else {
489
+ this.clearSelection();
490
+ }
463
491
  }
464
492
  }
465
493
  }
@@ -533,7 +561,9 @@ var TreeGrid = /** @class */ (function (_super) {
533
561
  TreeGrid.prototype.requiredModules = function () {
534
562
  var modules = [];
535
563
  var splitFrozenCount = 'splitFrozenCount';
536
- this.grid["" + splitFrozenCount](this.getColumns());
564
+ if (!this.isReact && isNullOrUndefined(this['changedProperties'].columns)) {
565
+ this.grid["" + splitFrozenCount](this.getColumns());
566
+ }
537
567
  if (this.isDestroyed) {
538
568
  return modules;
539
569
  }
@@ -653,7 +683,7 @@ var TreeGrid = /** @class */ (function (_super) {
653
683
  name: 'Edit'
654
684
  });
655
685
  }
656
- if (this.isCommandColumn(this.columns)) {
686
+ if (!isNullOrUndefined(this.columns) && this.isCommandColumn(this.columns)) {
657
687
  modules.push({
658
688
  member: 'commandColumn',
659
689
  args: [this],
@@ -786,6 +816,7 @@ var TreeGrid = /** @class */ (function (_super) {
786
816
  var root = 'root';
787
817
  this.grid["" + root] = this["" + root] ? this["" + root] : this;
788
818
  this.grid.appendTo(gridContainer);
819
+ this.actionFailureHandler();
789
820
  var gridContent = this.element.getElementsByClassName('e-gridcontent')[0].childNodes[0];
790
821
  gridContent.setAttribute('tabindex', '0');
791
822
  var contentTable = this.element.getElementsByClassName('e-content')[0].querySelector('.e-table');
@@ -808,6 +839,85 @@ var TreeGrid = /** @class */ (function (_super) {
808
839
  }
809
840
  };
810
841
  };
842
+ TreeGrid.prototype.actionFailureHandler = function () {
843
+ var _this = this;
844
+ var failureCases = [];
845
+ var primaryKeyFieldNames = this.getPrimaryKeyFieldNames();
846
+ var RecordsCount = this.flatData.length;
847
+ if ((this.editSettings.allowAdding || this.editSettings.allowDeleting || this.editSettings.allowEditing)
848
+ && primaryKeyFieldNames.length === 0 && RecordsCount !== 0) {
849
+ failureCases.push('For the CRUD actions, it is necessary to enable Primary Key field for the unique data column.');
850
+ }
851
+ if (this.allowRowDragAndDrop && primaryKeyFieldNames.length === 0 && RecordsCount !== 0) {
852
+ failureCases.push('For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column.');
853
+ }
854
+ if (this.allowPaging && this.enableVirtualization) {
855
+ failureCases.push('Paging is not allowed in virtualization case.');
856
+ }
857
+ if (RecordsCount === 0 && this.columns.length === 0) {
858
+ failureCases.push('Either of the Data source or columns should be given.');
859
+ }
860
+ if (this.frozenColumns > 0 && this.columnModel.filter(function (col) { return col.isFrozen; })) {
861
+ failureCases.push('Use only one attribute for Frozen either IsFrozen or FrozenColumns.');
862
+ }
863
+ if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
864
+ failureCases.push('Virtual scrolling is not compatible with the detail template');
865
+ }
866
+ if (this.stackedHeader && !isNullOrUndefined(this.detailTemplate)) {
867
+ failureCases.push('Virtual scrolling is not compatible with the detail template');
868
+ }
869
+ if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }) || this.frozenRows > 0)
870
+ && (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
871
+ failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
872
+ }
873
+ if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }).length > 0 || this.frozenRows > 0) && this.editSettings.mode === 'Cell') {
874
+ failureCases.push('Frozen rows and columns are not supported with cell editing.');
875
+ }
876
+ if (this.allowSelection && !isNullOrUndefined(this.rowTemplate)) {
877
+ failureCases.push('Selection is not supported in RowTemplate');
878
+ }
879
+ if (this.treeColumnIndex < 0) {
880
+ failureCases.push('For showing tree structure it is must to set the TreeColumnIndex value.');
881
+ }
882
+ if (this.treeColumnIndex >= this.columns.length) {
883
+ failureCases.push('TreeColumnIndex value should not exceed the total column count.');
884
+ }
885
+ if (this.enableVirtualization &&
886
+ (this.columnModel.some(function (col) { return /%$/.test(col.width); }) ||
887
+ /%$/.test(this.height.toString()))) {
888
+ failureCases.push('column width and height should be in pixels');
889
+ }
890
+ if ((this.childMapping !== 'Children') && !isNullOrUndefined(this.idMapping)) {
891
+ failureCases.push('Both IdMapping and ChildMapping should not be used together for tree grid rendering.');
892
+ }
893
+ if ((!isNullOrUndefined(this.idMapping) && (isNullOrUndefined(this.parentIdMapping))) ||
894
+ ((isNullOrUndefined(this.idMapping) && (!isNullOrUndefined(this.parentIdMapping))))) {
895
+ failureCases.push('IdMapping and ParentIdMapping properties should be defined and vice versa.');
896
+ }
897
+ var checkboxColumn = this.columnModel.filter(function (col) { return col.showCheckbox; });
898
+ var treeColumn = this.columns[this.treeColumnIndex];
899
+ if (checkboxColumn.length !== 0) {
900
+ if (checkboxColumn !== treeColumn) {
901
+ failureCases.push('ShowCheckbox column should not be defined other than the tree column.');
902
+ }
903
+ if (checkboxColumn.length > 1) {
904
+ failureCases.push('Only one column can have the ShowCheckbox option enabled.');
905
+ }
906
+ }
907
+ var alignColumn = this.columnModel.filter(function (col) { return col.textAlign === 'Right' && col.field === _this.columnModel[_this.treeColumnIndex].field; });
908
+ if (alignColumn.length !== 0) {
909
+ failureCases.push('TextAlign right for the tree column is not applicable.');
910
+ }
911
+ if (failureCases.length > 0) {
912
+ var failureEventArgs_1 = {
913
+ error: {}
914
+ };
915
+ failureCases.forEach(function (failureCase, index) {
916
+ failureEventArgs_1.error[parseInt(index.toString(), 10)] = failureCase;
917
+ });
918
+ this.trigger(events.actionFailure, failureEventArgs_1);
919
+ }
920
+ };
811
921
  TreeGrid.prototype.refreshToolbarItems = function () {
812
922
  var toolbarElement = this.toolbarModule.getToolbar();
813
923
  var indentID = this.element.id + '_gridcontrol_indent';
@@ -942,10 +1052,28 @@ var TreeGrid = /** @class */ (function (_super) {
942
1052
  var _this = this;
943
1053
  this.grid.rowSelecting = function (args) {
944
1054
  _this.IsExpandCollapseClicked(args);
1055
+ if (!isNullOrUndefined(args.data) && _this.selectionSettings.persistSelection
1056
+ && _this.columnModel.filter(function (col) { return col.type === 'checkbox'; }).length > 0 && isRemoteData(_this)) {
1057
+ if (!isNullOrUndefined(args.data.parentItem) || args.isHeaderCheckboxClicked) {
1058
+ _this.parentQuery = _this.query.queries.filter(function (q) { return q.e.field === _this.parentIdMapping; });
1059
+ _this.query.queries = _this.query.queries.slice(0, 0);
1060
+ }
1061
+ }
1062
+ if (_this.pageSettings.pageSizeMode === 'Root') {
1063
+ _this.grid.selectionModule['totalRecordsCount'] = _this.grid.currentViewData.length;
1064
+ }
1065
+ if (_this.enableVirtualization && args.rowIndex === _this.selectedRowIndex) {
1066
+ args.cancel = true;
1067
+ }
945
1068
  _this.trigger(events.rowSelecting, args);
946
1069
  };
947
1070
  this.grid.rowDeselecting = function (args) {
948
1071
  _this.IsExpandCollapseClicked(args);
1072
+ if (!isNullOrUndefined(args.data) && _this.selectionSettings.persistSelection
1073
+ && _this.columnModel.filter(function (col) { return col.type === 'checkbox'; }).length > 0 && isRemoteData(_this)) {
1074
+ _this.parentQuery = _this.query.queries.filter(function (q) { return q.e.field === _this.parentIdMapping; });
1075
+ _this.query.queries = _this.query.queries.slice(0, 0);
1076
+ }
949
1077
  _this.trigger(events.rowDeselecting, args);
950
1078
  };
951
1079
  this.grid.rowSelected = function (args) {
@@ -1019,7 +1147,9 @@ var TreeGrid = /** @class */ (function (_super) {
1019
1147
  }
1020
1148
  };
1021
1149
  this.grid.printComplete = this.triggerEvents.bind(this);
1022
- this.grid.actionFailure = this.triggerEvents.bind(this);
1150
+ this.grid.actionFailure = function (args) {
1151
+ _this.trigger(events.actionFailure, args);
1152
+ };
1023
1153
  this.extendedGridDataBoundEvent();
1024
1154
  this.extendedGridEvents();
1025
1155
  this.extendedGridActionEvents();
@@ -1084,6 +1214,16 @@ var TreeGrid = /** @class */ (function (_super) {
1084
1214
  _this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(index.toString(), 10)], index);
1085
1215
  }
1086
1216
  }
1217
+ if (_this.enableVirtualization && _this.selectionSettings.persistSelection
1218
+ && !isNullOrUndefined(_this.virtualScrollModule.prevSelectedRecord)) {
1219
+ for (var i = 0; i < _this.virtualScrollModule.prevSelectedRecord.length; i++) {
1220
+ var updateRowSelection = 'updateRowSelection';
1221
+ var index =
1222
+ // eslint-disable-next-line max-len
1223
+ _this.getCurrentViewRecords().indexOf(_this.virtualScrollModule.prevSelectedRecord[parseInt(i.toString(), 10)]);
1224
+ _this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(index.toString(), 10)], index);
1225
+ }
1226
+ }
1087
1227
  _this.trigger(events.dataBound, args);
1088
1228
  _this.initialRender = false;
1089
1229
  };
@@ -1696,6 +1836,12 @@ var TreeGrid = /** @class */ (function (_super) {
1696
1836
  TreeGrid.prototype.onPropertyChanged = function (newProp) {
1697
1837
  var properties = Object.keys(newProp);
1698
1838
  var requireRefresh = false;
1839
+ if (properties.indexOf('columns') > -1 && !isNullOrUndefined(newProp.columns) && this.frozenColumns === 0
1840
+ && this.frozenRows === 0 && !this.columnModel.some(function (col) { return col.isFrozen || col.freeze; })) {
1841
+ this.grid.columns = this.getGridColumns(newProp.columns);
1842
+ this.grid['updateColumnObject']();
1843
+ requireRefresh = true;
1844
+ }
1699
1845
  for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {
1700
1846
  var prop = properties_1[_i];
1701
1847
  switch (prop) {
@@ -2011,6 +2157,7 @@ var TreeGrid = /** @class */ (function (_super) {
2011
2157
  }
2012
2158
  };
2013
2159
  TreeGrid.prototype.mouseClickHandler = function (e) {
2160
+ var _this = this;
2014
2161
  if (!isNullOrUndefined(e.touches)) {
2015
2162
  return;
2016
2163
  }
@@ -2038,6 +2185,22 @@ var TreeGrid = /** @class */ (function (_super) {
2038
2185
  }
2039
2186
  }
2040
2187
  }
2188
+ if (((target.classList.contains('e-flmenu-cancelbtn') || target.classList.contains('e-flmenu-okbtn')
2189
+ || target.classList.contains('e-content') || target.classList.contains('e-rowcell'))
2190
+ && !isNullOrUndefined(this.filterModule) && this.isReact)) {
2191
+ if (!isNullOrUndefined(this.grid.filterModule['column'])) {
2192
+ if (this.grid.filterModule['column'].filterTemplate) {
2193
+ var elem = document.getElementById(this.grid.filterModule.filterModule['dlgObj'].element.id);
2194
+ this.grid.filterModule['fltrDlgDetails'].isOpen = false;
2195
+ if (this.grid.filterModule.filterModule['dlgObj'] && !this.grid.filterModule.filterModule['dlgObj'].isDestroyed && elem) {
2196
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2197
+ this.clearTemplate(['filterTemplate'], undefined, function () {
2198
+ _this.grid.filterModule.filterModule['dlgObj'].destroy();
2199
+ });
2200
+ }
2201
+ }
2202
+ }
2203
+ }
2041
2204
  };
2042
2205
  /**
2043
2206
  * Returns TreeGrid rows
@@ -2132,6 +2295,10 @@ var TreeGrid = /** @class */ (function (_super) {
2132
2295
  * @returns {void}
2133
2296
  */
2134
2297
  TreeGrid.prototype.deleteRecord = function (fieldName, data) {
2298
+ if ((isNullOrUndefined(fieldName) && (isNullOrUndefined(data)) || (this.getSelectedRecords().length <= 0))) {
2299
+ var error = 'The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number.';
2300
+ this.trigger(events.actionFailure, { error: error });
2301
+ }
2135
2302
  if (this.grid.editModule) {
2136
2303
  this.grid.editModule.deleteRecord(fieldName, data);
2137
2304
  }
@@ -2200,6 +2367,10 @@ var TreeGrid = /** @class */ (function (_super) {
2200
2367
  * @returns {void}
2201
2368
  */
2202
2369
  TreeGrid.prototype.deleteRow = function (tr) {
2370
+ if (isNullOrUndefined(tr)) {
2371
+ var error = 'The provided value for the tr is undefined. Please ensure the tr contains HTMLTableRowElement.';
2372
+ this.trigger(events.actionFailure, { error: error });
2373
+ }
2203
2374
  if (this.grid.editModule) {
2204
2375
  this.grid.editModule.deleteRow(tr);
2205
2376
  }
@@ -2225,9 +2396,11 @@ var TreeGrid = /** @class */ (function (_super) {
2225
2396
  this.grid.setCellValue(key, field, value);
2226
2397
  var rowIndex = this.grid.getRowIndexByPrimaryKey(key);
2227
2398
  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);
2399
+ if (isNullOrUndefined(record)) {
2400
+ var error = 'The provided value for the record is undefined. Please ensure the record contains ITreeData.';
2401
+ this.trigger(events.actionFailure, { error: error });
2230
2402
  }
2403
+ editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
2231
2404
  };
2232
2405
  /**
2233
2406
  * Updates and refresh the particular row values based on the given primary key value.
@@ -2278,6 +2451,10 @@ var TreeGrid = /** @class */ (function (_super) {
2278
2451
  * @returns {void}
2279
2452
  */
2280
2453
  TreeGrid.prototype.goToPage = function (pageNo) {
2454
+ if (isNullOrUndefined(pageNo)) {
2455
+ var error = 'The provided value for the pageNo is undefined. Please ensure the pageNo contains number.';
2456
+ this.trigger(events.actionFailure, { error: error });
2457
+ }
2281
2458
  if (this.grid.pagerModule) {
2282
2459
  this.grid.pagerModule.goToPage(pageNo);
2283
2460
  }
@@ -2379,6 +2556,10 @@ var TreeGrid = /** @class */ (function (_super) {
2379
2556
  * @returns {void}
2380
2557
  */
2381
2558
  TreeGrid.prototype.hideColumns = function (keys, hideBy) {
2559
+ if (isNullOrUndefined(keys)) {
2560
+ var error = 'The provided value for the keys is undefined. Please ensure the keys contains string.';
2561
+ this.trigger(events.actionFailure, { error: error });
2562
+ }
2382
2563
  this.grid.hideColumns(keys, hideBy);
2383
2564
  this.updateColumnModel();
2384
2565
  };
@@ -2476,10 +2657,10 @@ var TreeGrid = /** @class */ (function (_super) {
2476
2657
  if (this.grid.columns.length !== this.columnModel.length) {
2477
2658
  this.stackedHeader = true;
2478
2659
  }
2479
- if (this.stackedHeader && this.allowResizing) {
2660
+ if (this.stackedHeader && this.allowResizing && !isNullOrUndefined(this.columns)) {
2480
2661
  this.updateColumnsWidth(this.columns);
2481
2662
  }
2482
- if (!this.stackedHeader) {
2663
+ if (!this.stackedHeader && !isNullOrUndefined(this.columns)) {
2483
2664
  merge(this.columns, this.columnModel);
2484
2665
  }
2485
2666
  this["" + deepMerge] = undefined; // Workaround for blazor updateModel
@@ -2488,10 +2669,10 @@ var TreeGrid = /** @class */ (function (_super) {
2488
2669
  TreeGrid.prototype.updateColumnsWidth = function (columns) {
2489
2670
  var _this = this;
2490
2671
  columns.forEach(function (column) {
2491
- if (column.columns) {
2672
+ if (!isNullOrUndefined(column) && column.columns) {
2492
2673
  _this.updateColumnsWidth(column.columns);
2493
2674
  }
2494
- else if (column.field) {
2675
+ else if (!isNullOrUndefined(column) && column.field) {
2495
2676
  var currentColumn = _this.grid.getColumnByField(column.field);
2496
2677
  if (!isNullOrUndefined(currentColumn)) {
2497
2678
  column.width = currentColumn.width;
@@ -2796,6 +2977,11 @@ var TreeGrid = /** @class */ (function (_super) {
2796
2977
  */
2797
2978
  TreeGrid.prototype.expandRow = function (row, record, key, level) {
2798
2979
  var _this = this;
2980
+ this.isCollapseAll = false;
2981
+ if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key) && isNullOrUndefined(level)) {
2982
+ var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
2983
+ this.trigger(events.actionFailure, { error: error });
2984
+ }
2799
2985
  var parentRec = this.parentData;
2800
2986
  if (!this.enableVirtualization) {
2801
2987
  parentRec = this.flatData.filter(function (e) {
@@ -2819,13 +3005,13 @@ var TreeGrid = /** @class */ (function (_super) {
2819
3005
  if (expandingArgs.expandAll) {
2820
3006
  _this.expandCollapseAllChildren(record, 'expand', key, level);
2821
3007
  }
2822
- _this.expandRows(row, record, parentRec, key, level);
3008
+ _this.expandRows(row, record, parentRec);
2823
3009
  }
2824
3010
  });
2825
3011
  }
2826
3012
  else if ((!this.allowPaging || (pagerValuePresent && this.grid.pagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === 'All')) &&
2827
3013
  !this.expandAllPrevent && this.isExpandingEventTriggered) {
2828
- this.expandRows(row, record, parentRec, key, level);
3014
+ this.expandRows(row, record, parentRec);
2829
3015
  }
2830
3016
  this.isExpandingEventTriggered = true;
2831
3017
  }
@@ -2836,13 +3022,13 @@ var TreeGrid = /** @class */ (function (_super) {
2836
3022
  if (expandingArgs.expandAll) {
2837
3023
  _this.expandCollapseAllChildren(record, 'expand', key, level);
2838
3024
  }
2839
- _this.expandRows(row, record, parentRec, key, level);
3025
+ _this.expandRows(row, record, parentRec);
2840
3026
  }
2841
3027
  });
2842
3028
  }
2843
3029
  };
2844
3030
  // Internal method to handle the rows expand
2845
- TreeGrid.prototype.expandRows = function (row, record, parentRec, key, level) {
3031
+ TreeGrid.prototype.expandRows = function (row, record, parentRec) {
2846
3032
  this.expandCollapse('expand', row, record);
2847
3033
  var children = 'Children';
2848
3034
  if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record["" + children]))) {
@@ -2855,6 +3041,10 @@ var TreeGrid = /** @class */ (function (_super) {
2855
3041
  expandArgs = { data: parentRec, row: row };
2856
3042
  this.trigger(events.expanded, expandArgs);
2857
3043
  }
3044
+ else if (!this.isExpandAll && this.enableVirtualization && this.selectionSettings.persistSelection
3045
+ && !isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)) {
3046
+ this.virtualScrollModule.prevSelectedRecord = [];
3047
+ }
2858
3048
  else if (!this.isExpandAll) {
2859
3049
  this.trigger(events.expanded, expandArgs);
2860
3050
  }
@@ -2880,13 +3070,13 @@ var TreeGrid = /** @class */ (function (_super) {
2880
3070
  return e.hasChildRecords;
2881
3071
  });
2882
3072
  }
2883
- else if (isNullOrUndefined(record)) {
3073
+ else if (isNullOrUndefined(record) && !isNullOrUndefined(row)) {
2884
3074
  if (this.detailTemplate) {
2885
3075
  record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
2886
3076
  }
2887
3077
  else {
2888
- if (this.enableVirtualization && this.isCollapseAll) {
2889
- if (this.isExpandAll && row.rowIndex === -1) {
3078
+ if (this.enableVirtualization && (this.isCollapseAll || this.isExpandAll)) {
3079
+ if (row.rowIndex === -1) {
2890
3080
  record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
2891
3081
  }
2892
3082
  else {
@@ -2913,6 +3103,11 @@ var TreeGrid = /** @class */ (function (_super) {
2913
3103
  */
2914
3104
  TreeGrid.prototype.collapseRow = function (row, record, key) {
2915
3105
  var _this = this;
3106
+ this.isExpandAll = false;
3107
+ if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key)) {
3108
+ var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
3109
+ this.trigger(events.actionFailure, { error: error });
3110
+ }
2916
3111
  var parentRec = this.parentData;
2917
3112
  if (!this.enableVirtualization) {
2918
3113
  parentRec = this.flatData.filter(function (e) {
@@ -2929,12 +3124,12 @@ var TreeGrid = /** @class */ (function (_super) {
2929
3124
  if (collapsingArgs.collapseAll) {
2930
3125
  _this.expandCollapseAllChildren(record, 'collapse', key);
2931
3126
  }
2932
- _this.collapseRows(row, record, parentRec, key);
3127
+ _this.collapseRows(row, record, parentRec);
2933
3128
  }
2934
3129
  });
2935
3130
  }
2936
3131
  else if (!this.allowPaging && !this.collapseAllPrevent && this.isCollapsingEventTriggered) {
2937
- this.collapseRows(row, record, parentRec, key);
3132
+ this.collapseRows(row, record, parentRec);
2938
3133
  }
2939
3134
  this.isCollapsingEventTriggered = true;
2940
3135
  }
@@ -2942,13 +3137,13 @@ var TreeGrid = /** @class */ (function (_super) {
2942
3137
  var args = { data: record, row: row, cancel: false };
2943
3138
  this.trigger(events.collapsing, args, function (collapsingArgs) {
2944
3139
  if (!collapsingArgs.cancel && !isNullOrUndefined(record)) {
2945
- _this.collapseRows(row, record, parentRec, key);
3140
+ _this.collapseRows(row, record, parentRec);
2946
3141
  }
2947
3142
  });
2948
3143
  }
2949
3144
  };
2950
3145
  // Internal method for handling the rows collapse
2951
- TreeGrid.prototype.collapseRows = function (row, record, parentRec, key) {
3146
+ TreeGrid.prototype.collapseRows = function (row, record, parentRec) {
2952
3147
  this.expandCollapse('collapse', row, record);
2953
3148
  var collapseArgs = { data: record, row: row };
2954
3149
  if (!isRemoteData(this)) {
@@ -2992,6 +3187,10 @@ var TreeGrid = /** @class */ (function (_super) {
2992
3187
  * @returns {void}
2993
3188
  */
2994
3189
  TreeGrid.prototype.expandAtLevel = function (level) {
3190
+ if (isNullOrUndefined(level)) {
3191
+ var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
3192
+ this.trigger(events.actionFailure, { error: error });
3193
+ }
2995
3194
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
2996
3195
  var rec = this.grid.dataSource.filter(function (e) {
2997
3196
  if (e.hasChildRecords && e.level === level) {
@@ -3014,6 +3213,10 @@ var TreeGrid = /** @class */ (function (_super) {
3014
3213
  * @returns {void}
3015
3214
  */
3016
3215
  TreeGrid.prototype.expandByKey = function (key) {
3216
+ if (isNullOrUndefined(key)) {
3217
+ var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
3218
+ this.trigger(events.actionFailure, { error: error });
3219
+ }
3017
3220
  this.expandCollapseActionByKey(key, 'Expand');
3018
3221
  };
3019
3222
  TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
@@ -3071,6 +3274,10 @@ var TreeGrid = /** @class */ (function (_super) {
3071
3274
  * @returns {void}
3072
3275
  */
3073
3276
  TreeGrid.prototype.collapseAtLevel = function (level) {
3277
+ if (isNullOrUndefined(level)) {
3278
+ var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
3279
+ this.trigger(events.actionFailure, { error: error });
3280
+ }
3074
3281
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
3075
3282
  var record = this.grid.dataSource.filter(function (e) {
3076
3283
  if (e.hasChildRecords && e.level === level) {
@@ -3093,6 +3300,10 @@ var TreeGrid = /** @class */ (function (_super) {
3093
3300
  * @returns {void}
3094
3301
  */
3095
3302
  TreeGrid.prototype.collapseByKey = function (key) {
3303
+ if (isNullOrUndefined(key)) {
3304
+ var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
3305
+ this.trigger(events.actionFailure, { error: error });
3306
+ }
3096
3307
  this.expandCollapseActionByKey(key, 'Collapse');
3097
3308
  };
3098
3309
  TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {
@@ -3133,6 +3344,10 @@ var TreeGrid = /** @class */ (function (_super) {
3133
3344
  * @returns {void}
3134
3345
  */
3135
3346
  TreeGrid.prototype.expandAll = function () {
3347
+ if (this.getCurrentViewRecords().length === 0) {
3348
+ var error = 'The provided value for the datasource is undefined. Please ensure to add the dataSource.';
3349
+ this.trigger(events.actionFailure, { error: error });
3350
+ }
3136
3351
  this.isExpandedEventTriggered = false;
3137
3352
  this.isExpandingEventTriggered = false;
3138
3353
  this.expandCollapseAll('expand');
@@ -3143,6 +3358,10 @@ var TreeGrid = /** @class */ (function (_super) {
3143
3358
  * @returns {void}
3144
3359
  */
3145
3360
  TreeGrid.prototype.collapseAll = function () {
3361
+ if (this.getCurrentViewRecords().length === 0) {
3362
+ var error = 'The provided value for the datasource is undefined. Please ensure to add the dataSource.';
3363
+ this.trigger(events.actionFailure, { error: error });
3364
+ }
3146
3365
  this.isCollapsedEventTriggered = false;
3147
3366
  this.isCollapsingEventTriggered = false;
3148
3367
  this.expandCollapseAll('collapse');
@@ -3159,6 +3378,9 @@ var TreeGrid = /** @class */ (function (_super) {
3159
3378
  return e.querySelector('.e-treegrid' + (action === 'expand' ? 'collapse' : 'expand'));
3160
3379
  });
3161
3380
  }
3381
+ if (!rows.length && this.getRows().length) {
3382
+ rows.push(this.getRows()[0]);
3383
+ }
3162
3384
  this.isExpandAll = true;
3163
3385
  this.isCollapseAll = true;
3164
3386
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
@@ -3207,9 +3429,12 @@ var TreeGrid = /** @class */ (function (_super) {
3207
3429
  TreeGrid.prototype.expandCollapse = function (action, row, record, isChild) {
3208
3430
  var _this = this;
3209
3431
  var expandingArgs = { row: row, data: record, childData: [], requestType: action };
3210
- var childRecords = this.grid.currentViewData.filter(function (e) {
3211
- return e.parentUniqueID === record.uniqueID;
3212
- });
3432
+ var childRecords;
3433
+ if (!isNullOrUndefined(record)) {
3434
+ childRecords = this.grid.currentViewData.filter(function (e) {
3435
+ return e.parentUniqueID === record.uniqueID;
3436
+ });
3437
+ }
3213
3438
  var targetEle;
3214
3439
  if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
3215
3440
  this.updateChildOnDemand(expandingArgs);
@@ -3238,7 +3463,7 @@ var TreeGrid = /** @class */ (function (_super) {
3238
3463
  var displayAction = void 0;
3239
3464
  if (action === 'expand') {
3240
3465
  displayAction = 'table-row';
3241
- if (!isChild) {
3466
+ if (!isChild && !isNullOrUndefined(record)) {
3242
3467
  record.expanded = true;
3243
3468
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
3244
3469
  }
@@ -3259,7 +3484,7 @@ var TreeGrid = /** @class */ (function (_super) {
3259
3484
  }
3260
3485
  else {
3261
3486
  displayAction = 'none';
3262
- if (!isChild || isCountRequired(this)) {
3487
+ if ((!isChild || isCountRequired(this)) && !isNullOrUndefined(row)) {
3263
3488
  record.expanded = false;
3264
3489
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
3265
3490
  }
@@ -3702,6 +3927,10 @@ var TreeGrid = /** @class */ (function (_super) {
3702
3927
  * @returns {void}
3703
3928
  */
3704
3929
  TreeGrid.prototype.filterByColumn = function (fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {
3930
+ if (isNullOrUndefined(fieldName) && isNullOrUndefined(filterOperator) && isNullOrUndefined(filterValue)) {
3931
+ var error = 'The provided value for the fieldName, filterOperator and filterValue are undefined. Please ensure the fieldName, filterOperator and filterValue.';
3932
+ this.trigger(events.actionFailure, { error: error });
3933
+ }
3705
3934
  this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);
3706
3935
  };
3707
3936
  /**
@@ -3768,6 +3997,10 @@ var TreeGrid = /** @class */ (function (_super) {
3768
3997
  * @returns {void}
3769
3998
  */
3770
3999
  TreeGrid.prototype.paste = function (data, rowIndex, colIndex) {
4000
+ if (isNullOrUndefined(data) && isNullOrUndefined(rowIndex) && isNullOrUndefined(colIndex)) {
4001
+ var error = 'The provided value for the index is undefined. Please ensure the index contains number.';
4002
+ this.trigger(events.actionFailure, { error: error });
4003
+ }
3771
4004
  this.clipboardModule.paste(data, rowIndex, colIndex);
3772
4005
  };
3773
4006
  /**
@@ -3795,7 +4028,7 @@ var TreeGrid = /** @class */ (function (_super) {
3795
4028
  * @param {number} columnIndex - Specifies the column index.
3796
4029
  * @returns {Element} - Returns movable cell element from the indexes passed
3797
4030
  *
3798
-
4031
+ * @deprecated This method is deprecated. Use getCellFromIndex method instead.
3799
4032
  */
3800
4033
  TreeGrid.prototype.getMovableCellFromIndex = function (rowIndex, columnIndex) {
3801
4034
  return this.grid.getCellFromIndex(rowIndex, columnIndex);
@@ -3805,7 +4038,7 @@ var TreeGrid = /** @class */ (function (_super) {
3805
4038
  *
3806
4039
  * @returns {Element[]} - Returns element collection of movable rows
3807
4040
  *
3808
-
4041
+ * @deprecated This method is deprecated. Use getDataRows method instead.
3809
4042
  */
3810
4043
  TreeGrid.prototype.getMovableDataRows = function () {
3811
4044
  return this.grid.getDataRows();
@@ -3816,7 +4049,7 @@ var TreeGrid = /** @class */ (function (_super) {
3816
4049
  * @param {number} index - Specifies the row index.
3817
4050
  * @returns {Element} - Returns movable row based on index passed
3818
4051
  *
3819
-
4052
+ * @deprecated This method is deprecated. Use getRowByIndex method instead.
3820
4053
  */
3821
4054
  TreeGrid.prototype.getMovableRowByIndex = function (index) {
3822
4055
  return this.grid.getRowByIndex(index);
@@ -3825,7 +4058,7 @@ var TreeGrid = /** @class */ (function (_super) {
3825
4058
  * Gets the TreeGrid's movable content rows from frozen treegrid.
3826
4059
  *
3827
4060
  * @returns {Element[]}: Returns movable row element
3828
-
4061
+ * @deprecated This method is deprecated. Use getRows method instead.
3829
4062
  */
3830
4063
  TreeGrid.prototype.getMovableRows = function () {
3831
4064
  return this.grid.getRows();
@@ -3836,7 +4069,7 @@ var TreeGrid = /** @class */ (function (_super) {
3836
4069
  * @param {number} index - Specifies the row index.
3837
4070
  * @returns {Element} returns the element
3838
4071
  *
3839
-
4072
+ * @deprecated This method is deprecated. Use getRowByIndex method instead.
3840
4073
  */
3841
4074
  TreeGrid.prototype.getFrozenRightRowByIndex = function (index) {
3842
4075
  return this.grid.getRowByIndex(index);
@@ -3846,7 +4079,7 @@ var TreeGrid = /** @class */ (function (_super) {
3846
4079
  *
3847
4080
  * @returns {Element[]} returns the element
3848
4081
  *
3849
-
4082
+ * @deprecated This method is deprecated. Use getRows method instead.
3850
4083
  */
3851
4084
  TreeGrid.prototype.getFrozenRightRows = function () {
3852
4085
  return this.grid.getRows();
@@ -3856,7 +4089,7 @@ var TreeGrid = /** @class */ (function (_super) {
3856
4089
  *
3857
4090
  * @returns {Element[]} Returns the Element
3858
4091
  *
3859
-
4092
+ * @deprecated This method is deprecated. Use getDataRows method instead.
3860
4093
  */
3861
4094
  TreeGrid.prototype.getFrozenRightDataRows = function () {
3862
4095
  return this.grid.getDataRows();
@@ -3868,7 +4101,7 @@ var TreeGrid = /** @class */ (function (_super) {
3868
4101
  * @param {number} columnIndex - Specifies the column index.
3869
4102
  * @returns {Element} Returns the Element
3870
4103
  *
3871
-
4104
+ * @deprecated This method is deprecated. Use getCellFromIndex method instead.
3872
4105
  */
3873
4106
  TreeGrid.prototype.getFrozenRightCellFromIndex = function (rowIndex, columnIndex) {
3874
4107
  return this.grid.getCellFromIndex(rowIndex, columnIndex);
@@ -3879,7 +4112,7 @@ var TreeGrid = /** @class */ (function (_super) {
3879
4112
  * @param {number} index - Specifies the column index.
3880
4113
  * @returns {Element} Returns the Element
3881
4114
  *
3882
-
4115
+ * @deprecated This method is deprecated. Use getColumnHeaderByIndex method instead.
3883
4116
  */
3884
4117
  TreeGrid.prototype.getFrozenLeftColumnHeaderByIndex = function (index) {
3885
4118
  return this.grid.getColumnHeaderByIndex(index);
@@ -3890,7 +4123,7 @@ var TreeGrid = /** @class */ (function (_super) {
3890
4123
  * @param {number} index - Specifies the column index.
3891
4124
  * @returns {Element} Returns the Element
3892
4125
  *
3893
-
4126
+ * @deprecated This method is deprecated. Use getColumnHeaderByIndex method instead.
3894
4127
  */
3895
4128
  TreeGrid.prototype.getFrozenRightColumnHeaderByIndex = function (index) {
3896
4129
  return this.grid.getColumnHeaderByIndex(index);
@@ -3901,7 +4134,7 @@ var TreeGrid = /** @class */ (function (_super) {
3901
4134
  * @param {number} index - Specifies the column index.
3902
4135
  * @returns {Element} Returns the Element
3903
4136
  *
3904
-
4137
+ * @deprecated This method is deprecated. Use getColumnHeaderByIndex method instead.
3905
4138
  */
3906
4139
  TreeGrid.prototype.getMovableColumnHeaderByIndex = function (index) {
3907
4140
  return this.grid.getColumnHeaderByIndex(index);
@@ -3979,7 +4212,7 @@ var TreeGrid = /** @class */ (function (_super) {
3979
4212
  * @returns {number} - Returns frozen column count
3980
4213
  */
3981
4214
  TreeGrid.prototype.getFrozenColumns = function () {
3982
- return this.getFrozenCount(this.columns, 0) + this.frozenColumns;
4215
+ return this.getFrozenCount(!isNullOrUndefined(this.columns) && this.columns, 0) + this.frozenColumns;
3983
4216
  };
3984
4217
  TreeGrid.prototype.getFrozenCount = function (cols, cnt) {
3985
4218
  for (var j = 0, len = cols.length; j < len; j++) {
@@ -4036,6 +4269,10 @@ var TreeGrid = /** @class */ (function (_super) {
4036
4269
  * @returns {void}
4037
4270
  */
4038
4271
  TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {
4272
+ if (isNullOrUndefined(fromIndexes) && isNullOrUndefined(toIndex) && isNullOrUndefined(position)) {
4273
+ 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.';
4274
+ this.trigger(events.actionFailure, { error: error });
4275
+ }
4039
4276
  this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);
4040
4277
  };
4041
4278
  /**