@syncfusion/ej2-treegrid 19.3.45 → 19.3.53

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 (55) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/ej2-treegrid.umd.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treegrid.es2015.js +249 -87
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +241 -79
  7. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  8. package/dist/global/ej2-treegrid.min.js +2 -2
  9. package/dist/global/ej2-treegrid.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +9 -9
  12. package/src/treegrid/actions/batch-edit.js +19 -7
  13. package/src/treegrid/actions/crud-actions.js +1 -0
  14. package/src/treegrid/actions/edit.js +14 -7
  15. package/src/treegrid/actions/freeze-column.js +2 -1
  16. package/src/treegrid/actions/rowdragdrop.js +10 -4
  17. package/src/treegrid/actions/selection.js +8 -3
  18. package/src/treegrid/actions/virtual-scroll.js +13 -2
  19. package/src/treegrid/base/constant.d.ts +4 -0
  20. package/src/treegrid/base/constant.js +4 -0
  21. package/src/treegrid/base/treegrid-model.d.ts +8 -0
  22. package/src/treegrid/base/treegrid.d.ts +8 -0
  23. package/src/treegrid/base/treegrid.js +46 -17
  24. package/src/treegrid/renderer/render.js +9 -1
  25. package/src/treegrid/renderer/virtual-row-model-generator.d.ts +1 -0
  26. package/src/treegrid/renderer/virtual-row-model-generator.js +12 -0
  27. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +2 -1
  28. package/src/treegrid/renderer/virtual-tree-content-render.js +102 -35
  29. package/styles/bootstrap-dark.css +1 -1
  30. package/styles/bootstrap.css +1 -1
  31. package/styles/bootstrap4.css +6 -1
  32. package/styles/bootstrap5-dark.css +6 -1
  33. package/styles/bootstrap5.css +6 -1
  34. package/styles/fabric-dark.css +1 -1
  35. package/styles/fabric.css +1 -1
  36. package/styles/highcontrast-light.css +1 -1
  37. package/styles/highcontrast.css +1 -1
  38. package/styles/material-dark.css +1 -1
  39. package/styles/material.css +1 -1
  40. package/styles/tailwind-dark.css +1 -1
  41. package/styles/tailwind.css +1 -1
  42. package/styles/treegrid/_layout.scss +1 -1
  43. package/styles/treegrid/bootstrap-dark.css +1 -1
  44. package/styles/treegrid/bootstrap.css +1 -1
  45. package/styles/treegrid/bootstrap4.css +6 -1
  46. package/styles/treegrid/bootstrap5-dark.css +6 -1
  47. package/styles/treegrid/bootstrap5.css +6 -1
  48. package/styles/treegrid/fabric-dark.css +1 -1
  49. package/styles/treegrid/fabric.css +1 -1
  50. package/styles/treegrid/highcontrast-light.css +1 -1
  51. package/styles/treegrid/highcontrast.css +1 -1
  52. package/styles/treegrid/material-dark.css +1 -1
  53. package/styles/treegrid/material.css +1 -1
  54. package/styles/treegrid/tailwind-dark.css +1 -1
  55. package/styles/treegrid/tailwind.css +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.3.45
3
+ * version : 19.3.53
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-treegrid@*",
3
- "_id": "@syncfusion/ej2-treegrid@19.3.44",
3
+ "_id": "@syncfusion/ej2-treegrid@19.3.47",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-uy3Okez3Wq7Xp1v9znGLXpc/bQMjSXzQNktNVfYxJvcXPgh7GKbKdIDhuzIE3b8R6p2i8zmYyDGrepiraR9oZw==",
5
+ "_integrity": "sha512-1qAa8qD3pixiqbAaV3Iqu5V6+3NzXa8G+EHL6QLhJF0fo/Fgj4DOuEUXSnQCy602s3YVzqSSPSAboKUvBNe4gg==",
6
6
  "_location": "/@syncfusion/ej2-treegrid",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -24,8 +24,8 @@
24
24
  "/@syncfusion/ej2-react-treegrid",
25
25
  "/@syncfusion/ej2-vue-treegrid"
26
26
  ],
27
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.3.44.tgz",
28
- "_shasum": "ab8aa46930d22cb52cf4776a2233044b8169d9f7",
27
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.3.47.tgz",
28
+ "_shasum": "9d3509b03b5ef89e7c2517ecea267f4908255bb6",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
31
31
  "author": {
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~19.3.43",
40
- "@syncfusion/ej2-data": "~19.3.44",
41
- "@syncfusion/ej2-grids": "~19.3.45",
42
- "@syncfusion/ej2-popups": "~19.3.43"
39
+ "@syncfusion/ej2-base": "~19.3.53",
40
+ "@syncfusion/ej2-data": "~19.3.53",
41
+ "@syncfusion/ej2-grids": "~19.3.53",
42
+ "@syncfusion/ej2-popups": "~19.3.53"
43
43
  },
44
44
  "deprecated": false,
45
45
  "description": "Essential JS 2 TreeGrid Component",
@@ -60,6 +60,6 @@
60
60
  "url": "git+https://github.com/syncfusion/ej2-treegrid.git"
61
61
  },
62
62
  "typings": "index.d.ts",
63
- "version": "19.3.45",
63
+ "version": "19.3.53",
64
64
  "sideEffects": false
65
65
  }
@@ -111,10 +111,11 @@ var BatchEdit = /** @class */ (function () {
111
111
  if (frozenCols && args.columnObject.index > frozenCols) {
112
112
  actualCellIndex = actualCellIndex + frozenCols;
113
113
  }
114
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 || this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
114
+ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
115
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
115
116
  if (freeze) {
116
117
  var colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;
117
- if (colCount == this.parent.treeColumnIndex) {
118
+ if (colCount === this.parent.treeColumnIndex) {
118
119
  this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
119
120
  column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
120
121
  });
@@ -276,7 +277,7 @@ var BatchEdit = /** @class */ (function () {
276
277
  focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
277
278
  }
278
279
  };
279
- BatchEdit.prototype.beforeBatchDelete = function () {
280
+ BatchEdit.prototype.beforeBatchDelete = function (args) {
280
281
  if (!this.batchRecords.length) {
281
282
  this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());
282
283
  this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());
@@ -286,9 +287,19 @@ var BatchEdit = /** @class */ (function () {
286
287
  var row = [];
287
288
  var records = [];
288
289
  var primarykey = this.parent.grid.getPrimaryKeyFieldNames()[0];
289
- var data = this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length - 1];
290
- var childs = findChildrenRecords(data);
291
- var uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
290
+ var data;
291
+ var childs;
292
+ var uid;
293
+ if (!isNullOrUndefined(args.row) && this.parent.getSelectedRows().indexOf(args.row) === -1) {
294
+ data = args.rowData;
295
+ childs = findChildrenRecords(data);
296
+ uid = args.row.getAttribute('data-uid');
297
+ }
298
+ else {
299
+ data = this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length - 1];
300
+ childs = findChildrenRecords(data);
301
+ uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
302
+ }
292
303
  var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);
293
304
  if (childs.length) {
294
305
  var totalCount = parentRowIndex + childs.length;
@@ -328,7 +339,8 @@ var BatchEdit = /** @class */ (function () {
328
339
  for (var i = 0; i < rows.length; i++) {
329
340
  rows[i].setAttribute('aria-rowindex', i.toString());
330
341
  }
331
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 || this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
342
+ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
343
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
332
344
  if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
333
345
  var mRows = this.parent.grid.getMovableDataRows();
334
346
  var freezeRightRows = this.parent.grid.getFrozenRightDataRows();
@@ -66,6 +66,7 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
66
66
  var childRecords = parentData ? parentData[control.childMapping] : [];
67
67
  for (var p = childRecords.length - 1; p >= 0; p--) {
68
68
  if (childRecords[p][control.idMapping] === currentData_1[control.idMapping]) {
69
+ parentData['childRecords'].splice(p, 1);
69
70
  childRecords.splice(p, 1);
70
71
  if (!childRecords.length) {
71
72
  parentData.hasChildRecords = false;
@@ -260,7 +260,7 @@ var Edit = /** @class */ (function () {
260
260
  if (args.action === 'f2') {
261
261
  this.recordDoubleClick(args);
262
262
  }
263
- if (args.action == 'escape') {
263
+ if (args.action === 'escape') {
264
264
  this.parent.closeEdit();
265
265
  }
266
266
  };
@@ -371,12 +371,13 @@ var Edit = /** @class */ (function () {
371
371
  });
372
372
  }
373
373
  else {
374
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 || this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
374
+ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
375
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
375
376
  if (freeze) {
376
- if (this.parent.getRows().indexOf(row_1) != -1) {
377
+ if (this.parent.getRows().indexOf(row_1) !== -1) {
377
378
  rowIndex_1 = this.parent.getRows().indexOf(row_1);
378
379
  }
379
- else if (this.parent.getFrozenRightRows().indexOf(row_1) != -1) {
380
+ else if (this.parent.getFrozenRightRows().indexOf(row_1) !== -1) {
380
381
  rowIndex_1 = this.parent.getFrozenRightRows().indexOf(row_1);
381
382
  }
382
383
  else {
@@ -443,7 +444,8 @@ var Edit = /** @class */ (function () {
443
444
  this.isOnBatch = false;
444
445
  }
445
446
  this.enableToolbarItems('save');
446
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 || this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
447
+ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
448
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
447
449
  if (freeze) {
448
450
  if (args.cell.closest('.e-frozen-left-header') || args.cell.closest('.e-frozen-left-content')) {
449
451
  mRow = this.parent.grid.getRows()[rowIndex];
@@ -480,7 +482,7 @@ var Edit = /** @class */ (function () {
480
482
  type: 'save', column: this.parent.getColumnByField(args.columnName), data: args.rowData,
481
483
  previousData: args.previousValue, row: row, target: args.cell
482
484
  };
483
- if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary == true; }).length) {
485
+ if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
484
486
  this.parent.grid.refresh();
485
487
  }
486
488
  this.parent.trigger(events.actionComplete, saveArgs);
@@ -522,6 +524,10 @@ var Edit = /** @class */ (function () {
522
524
  }
523
525
  }
524
526
  setValue('uniqueIDCollection.' + data[i].uniqueID + '.index', i, this.parent);
527
+ var adaptor = this.parent.dataSource.adaptor;
528
+ if ((isRemoteData(this.parent) || adaptor instanceof RemoteSaveAdaptor)) {
529
+ setValue('uniqueIDCollection.' + data[i].uniqueID, data[i], this.parent);
530
+ }
525
531
  if (!data[i].level) {
526
532
  this.parent.parentData.push(data[i]);
527
533
  }
@@ -641,7 +647,8 @@ var Edit = /** @class */ (function () {
641
647
  this.parent.grid.contentModule[r].splice(0, 1);
642
648
  this.parent.grid.contentModule[r].splice(rowObjectIndex, 0, newRowObject);
643
649
  }
644
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 || this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
650
+ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
651
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
645
652
  if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
646
653
  var movableRows = this.parent.getMovableDataRows();
647
654
  var frows = 'freezeRows';
@@ -35,7 +35,8 @@ var Freeze = /** @class */ (function () {
35
35
  var frozenrows = this.parent.getRows();
36
36
  var rows;
37
37
  var frozenRightRows;
38
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 || this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
38
+ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
39
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
39
40
  if (freeze) {
40
41
  frozenRightRows = this.parent.getFrozenRightRows().filter(function (e) {
41
42
  return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));
@@ -351,7 +351,8 @@ var RowDD = /** @class */ (function () {
351
351
  var bottomRowSegment = middleRowSegment + divide;
352
352
  var mouseEvent = getObject('originalEvent.event', args);
353
353
  var touchEvent = getObject('originalEvent.event', args);
354
- var posy = (mouseEvent.type == "mousemove") ? mouseEvent.pageY : ((!isNullOrUndefined(touchEvent) && !isNullOrUndefined(touchEvent.changedTouches)) ? touchEvent.changedTouches[0].pageY : null);
354
+ var posy = (mouseEvent.type === 'mousemove') ? mouseEvent.pageY : ((!isNullOrUndefined(touchEvent) &&
355
+ !isNullOrUndefined(touchEvent.changedTouches)) ? touchEvent.changedTouches[0].pageY : null);
355
356
  var isTopSegment = posy <= topRowSegment;
356
357
  var isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);
357
358
  var isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);
@@ -578,7 +579,7 @@ var RowDD = /** @class */ (function () {
578
579
  }
579
580
  else {
580
581
  if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&
581
- parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID) {
582
+ parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {
582
583
  setValue('dropPosition', this.dropPosition, args);
583
584
  tObj.trigger(events.rowDrop, args);
584
585
  if (!args.cancel && tObj.rowDropSettings.targetID) {
@@ -905,6 +906,11 @@ var RowDD = /** @class */ (function () {
905
906
  draggedRecord.parentItem = parentItem;
906
907
  draggedRecord.parentUniqueID = droppedRecord.uniqueID;
907
908
  droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);
909
+ var isSelfReference = 'isSelfReference';
910
+ if (tObj[isSelfReference]) {
911
+ droppedRecord[tObj.childMapping] = [];
912
+ droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);
913
+ }
908
914
  if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {
909
915
  droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);
910
916
  }
@@ -943,7 +949,7 @@ var RowDD = /** @class */ (function () {
943
949
  }
944
950
  length = record.childRecords.length;
945
951
  for (var i = 0; i < length; i++) {
946
- currentRecord = record.childRecords[i];
952
+ currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);
947
953
  count++;
948
954
  tObj.flatData.splice(count, 0, currentRecord);
949
955
  setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);
@@ -965,7 +971,7 @@ var RowDD = /** @class */ (function () {
965
971
  }
966
972
  length = record.childRecords.length;
967
973
  for (var i = 0; i < length; i++) {
968
- currentRecord = record.childRecords[i];
974
+ currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);
969
975
  var parentData = void 0;
970
976
  if (record.parentItem) {
971
977
  parentData = getParentData(this.parent, record.parentItem.uniqueID);
@@ -261,11 +261,11 @@ var Selection = /** @class */ (function () {
261
261
  var length = 0;
262
262
  if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {
263
263
  var filterResult = this.parent.filterModule.filteredResult;
264
- if (this.filteredList.length == 0) {
264
+ if (this.filteredList.length === 0) {
265
265
  this.filteredList = filterResult;
266
266
  }
267
267
  else {
268
- if (this.filteredList != filterResult) {
268
+ if (this.filteredList !== filterResult) {
269
269
  this.filteredList = filterResult;
270
270
  }
271
271
  }
@@ -434,7 +434,12 @@ var Selection = /** @class */ (function () {
434
434
  this.parent.getCurrentViewRecords() : this.parent.flatData;
435
435
  childData.forEach(function (record) {
436
436
  if (_this.parent.enableVirtualization) {
437
- record.hasChildRecords ? _this.updateParentSelection(record) : _this.updateSelectedItems(record, record.checkboxState);
437
+ if (record.hasChildRecords) {
438
+ _this.updateParentSelection(record);
439
+ }
440
+ else {
441
+ _this.updateSelectedItems(record, record.checkboxState);
442
+ }
438
443
  var child = findChildrenRecords(record);
439
444
  child = _this.getFilteredChildRecords(child);
440
445
  for (var i = 0; i < child.length; i++) {
@@ -18,6 +18,7 @@ import * as events from '../base/constant';
18
18
  import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
19
19
  import { getExpandStatus } from '../utils';
20
20
  import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';
21
+ import { VirtualHeaderRenderer } from '@syncfusion/ej2-grids';
21
22
  /**
22
23
  * TreeGrid Virtual Scroll module will handle Virtualization
23
24
  *
@@ -53,8 +54,12 @@ var VirtualScroll = /** @class */ (function () {
53
54
  * @returns {void}
54
55
  */
55
56
  VirtualScroll.prototype.addEventListener = function () {
57
+ if (this.parent.isDestroyed) {
58
+ return;
59
+ }
56
60
  this.parent.on(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds, this);
57
61
  this.parent.on(events.pagingActions, this.virtualPageAction, this);
62
+ this.parent.on(events.destroy, this.destroy, this);
58
63
  };
59
64
  /**
60
65
  * @hidden
@@ -66,6 +71,7 @@ var VirtualScroll = /** @class */ (function () {
66
71
  }
67
72
  this.parent.off(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds);
68
73
  this.parent.off(events.pagingActions, this.virtualPageAction);
74
+ this.parent.off(events.destroy, this.destroy);
69
75
  };
70
76
  VirtualScroll.prototype.collapseExpandVirtualchilds = function (row) {
71
77
  this.parent.grid.notify(events.virtualActionArgs, { isExpandCollapse: true });
@@ -121,7 +127,7 @@ var VirtualScroll = /** @class */ (function () {
121
127
  var resourceCount = this.parent.getRows();
122
128
  var sIndex = visualData.indexOf(this.expandCollapseRec);
123
129
  var tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);
124
- if (tempdata.length < resourceCount.length && sIndex >= 0) {
130
+ if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {
125
131
  sIndex = visualData.length - resourceCount.length;
126
132
  sIndex = sIndex > 0 ? sIndex : 0;
127
133
  startIndex = sIndex;
@@ -134,7 +140,7 @@ var VirtualScroll = /** @class */ (function () {
134
140
  }
135
141
  }
136
142
  //}
137
- if (!isNullOrUndefined(this.expandCollapseRec) && this.parent.enableCollapseAll) {
143
+ if ((this.parent.enableCollapseAll || this.parent.expandStateMapping) && !isNullOrUndefined(this.expandCollapseRec)) {
138
144
  if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {
139
145
  startIndex = 0;
140
146
  }
@@ -173,8 +179,13 @@ var TreeVirtual = /** @class */ (function (_super) {
173
179
  return 'treeVirtualScroll';
174
180
  };
175
181
  TreeVirtual.prototype.instantiateRenderers = function () {
182
+ var parentGrid = getValue('parent', this);
176
183
  getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
177
184
  var renderer = getValue('locator', this).getService('rendererFactory');
185
+ if (parentGrid.enableColumnVirtualization) {
186
+ getValue('addRenderer', renderer)
187
+ .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
188
+ }
178
189
  getValue('addRenderer', renderer)
179
190
  .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
180
191
  //renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
@@ -97,6 +97,8 @@ export declare const virtualColumnIndex: string;
97
97
  /** @hidden */
98
98
  export declare const virtualActionArgs: string;
99
99
  /** @hidden */
100
+ export declare const destroy: string;
101
+ /** @hidden */
100
102
  export declare const dataListener: string;
101
103
  /** @hidden */
102
104
  export declare const indexModifier: string;
@@ -124,3 +126,5 @@ export declare const rowsRemove: string;
124
126
  export declare const rowdraging: string;
125
127
  /** @hidden */
126
128
  export declare const rowDropped: string;
129
+ /** @hidden */
130
+ export declare const autoCol: string;
@@ -97,6 +97,8 @@ export var virtualColumnIndex = 'virtualColumnIndex';
97
97
  /** @hidden */
98
98
  export var virtualActionArgs = 'virtual-action-args';
99
99
  /** @hidden */
100
+ export var destroy = 'destroy';
101
+ /** @hidden */
100
102
  export var dataListener = 'data-listener';
101
103
  /** @hidden */
102
104
  export var indexModifier = 'index-modifier';
@@ -124,3 +126,5 @@ export var rowsRemove = 'rows-remove';
124
126
  export var rowdraging = 'row-draging';
125
127
  /** @hidden */
126
128
  export var rowDropped = 'row-dropped';
129
+ /** @hidden */
130
+ export var autoCol = 'auto-col';
@@ -462,6 +462,14 @@ export interface TreeGridModel extends ComponentModel{
462
462
  */
463
463
  enableVirtualization?: boolean;
464
464
 
465
+ /**
466
+ * If `enableColumnVirtualization` set to true, then the Tree Grid will render only the columns visible within the view-port
467
+ * and load subsequent columns on horizontal scrolling. This helps to load large dataset of columns in Tree Grid.
468
+ *
469
+ * @default false
470
+ */
471
+ enableColumnVirtualization?: boolean;
472
+
465
473
  /**
466
474
  * If `enableInfiniteScrolling` set to true, then the data will be loaded in TreeGrid when the scrollbar reaches the end.
467
475
  * This helps to load large dataset in TreeGrid.
@@ -566,6 +566,13 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
566
566
  * @default false
567
567
  */
568
568
  enableVirtualization: boolean;
569
+ /**
570
+ * If `enableColumnVirtualization` set to true, then the Tree Grid will render only the columns visible within the view-port
571
+ * and load subsequent columns on horizontal scrolling. This helps to load large dataset of columns in Tree Grid.
572
+ *
573
+ * @default false
574
+ */
575
+ enableColumnVirtualization: boolean;
569
576
  /**
570
577
  * If `enableInfiniteScrolling` set to true, then the data will be loaded in TreeGrid when the scrollbar reaches the end.
571
578
  * This helps to load large dataset in TreeGrid.
@@ -1491,6 +1498,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1491
1498
  * @returns {number} - Returns column index
1492
1499
  */
1493
1500
  getColumnIndexByField(field: string): number;
1501
+ private getVirtualColIndexByUid;
1494
1502
  /**
1495
1503
  * Gets a column index by UID.
1496
1504
  *
@@ -441,7 +441,8 @@ var TreeGrid = /** @class */ (function (_super) {
441
441
  member: 'ExcelExport', args: [this]
442
442
  });
443
443
  }
444
- if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() || this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
444
+ if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
445
+ this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
445
446
  modules.push({
446
447
  member: 'freeze', args: [this]
447
448
  });
@@ -662,6 +663,7 @@ var TreeGrid = /** @class */ (function (_super) {
662
663
  this.grid.allowSorting = this.allowSorting;
663
664
  this.grid.allowFiltering = this.allowFiltering;
664
665
  this.grid.enableVirtualization = this.enableVirtualization;
666
+ this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
665
667
  this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;
666
668
  this.grid.infiniteScrollSettings = this.infiniteScrollSettings;
667
669
  this.grid.width = this.width;
@@ -1023,6 +1025,10 @@ var TreeGrid = /** @class */ (function (_super) {
1023
1025
  && (_this.grid.filterSettings.columns.length === 0 || _this.grid.searchSettings.key.length === 0)) {
1024
1026
  _this.notify('clearFilters', { flatData: _this.grid.dataSource });
1025
1027
  _this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
1028
+ if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
1029
+ _this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ? _this.grid.dataSource :
1030
+ (isNullOrUndefined(_this.grid.dataSource) ? new DataManager() : new DataManager(_this.grid.dataSource));
1031
+ }
1026
1032
  }
1027
1033
  var callBackPromise = new Deferred();
1028
1034
  _this.trigger(events.actionBegin, args, function (actionArgs) {
@@ -1048,7 +1054,7 @@ var TreeGrid = /** @class */ (function (_super) {
1048
1054
  _this.notify(events.batchSave, args);
1049
1055
  }
1050
1056
  _this.notify('updateGridActions', args);
1051
- if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary == true; }).length) {
1057
+ if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
1052
1058
  _this.grid.refresh();
1053
1059
  }
1054
1060
  _this.trigger(events.actionComplete, args);
@@ -1344,6 +1350,9 @@ var TreeGrid = /** @class */ (function (_super) {
1344
1350
  case 'enableVirtualization':
1345
1351
  this.grid.enableVirtualization = this.enableVirtualization;
1346
1352
  break;
1353
+ case 'enableColumnVirtualization':
1354
+ this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
1355
+ break;
1347
1356
  case 'toolbar':
1348
1357
  this.grid.toolbar = this.getGridToolbar();
1349
1358
  break;
@@ -1567,6 +1576,11 @@ var TreeGrid = /** @class */ (function (_super) {
1567
1576
  if (isNullOrUndefined(this.grid)) {
1568
1577
  return;
1569
1578
  }
1579
+ if (!isNullOrUndefined(this.rowDropSettings.targetID) &&
1580
+ isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))) {
1581
+ document.getElementById(this.rowDropSettings.targetID).id = this.grid.rowDropSettings.targetID;
1582
+ this.rowDropSettings.targetID = this.grid.rowDropSettings.targetID;
1583
+ }
1570
1584
  _super.prototype.dataBind.call(this);
1571
1585
  this.grid.dataBind();
1572
1586
  };
@@ -1578,7 +1592,7 @@ var TreeGrid = /** @class */ (function (_super) {
1578
1592
  */
1579
1593
  TreeGrid.prototype.getPersistData = function () {
1580
1594
  var keyEntity = ['pageSettings', 'sortSettings',
1581
- 'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex'];
1595
+ 'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex', 'treeColumnIndex'];
1582
1596
  var ignoreOnPersist = {
1583
1597
  pageSettings: ['template', 'pageSizes', 'pageSizeMode', 'enableQueryString', 'totalRecordsCount', 'pageCount'],
1584
1598
  filterSettings: ['type', 'mode', 'showFilterBarStatus', 'immediateModeDelay', 'ignoreAccent', 'hierarchyMode'],
@@ -1589,9 +1603,9 @@ var TreeGrid = /** @class */ (function (_super) {
1589
1603
  'commandTemplate', 'commands', 'dataSource'];
1590
1604
  for (var i = 0; i < keyEntity.length; i++) {
1591
1605
  var currentObject = this[keyEntity[i]];
1592
- for (var _i = 0, _a = ignoreOnPersist[keyEntity[i]]; _i < _a.length; _i++) {
1593
- var val = _a[_i];
1594
- delete currentObject[val];
1606
+ for (var k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
1607
+ var objVal = val[k];
1608
+ delete currentObject[objVal];
1595
1609
  }
1596
1610
  }
1597
1611
  this.ignoreInArrays(ignoreOnColumn, this.columns);
@@ -1994,6 +2008,16 @@ var TreeGrid = /** @class */ (function (_super) {
1994
2008
  TreeGrid.prototype.getColumnIndexByField = function (field) {
1995
2009
  return this.grid.getColumnIndexByField(field);
1996
2010
  };
2011
+ TreeGrid.prototype.getVirtualColIndexByUid = function (uid) {
2012
+ var columnModel = 'columnModel';
2013
+ var index = iterateArrayOrObject(this.grid[columnModel], function (item, index) {
2014
+ if (item.uid === uid) {
2015
+ return index;
2016
+ }
2017
+ return undefined;
2018
+ })[0];
2019
+ return !isNullOrUndefined(index) ? index : -1;
2020
+ };
1997
2021
  /**
1998
2022
  * Gets a column index by UID.
1999
2023
  *
@@ -2022,18 +2046,20 @@ var TreeGrid = /** @class */ (function (_super) {
2022
2046
  temp = this.columnModel[this.treeColumnIndex].template;
2023
2047
  field = this.columnModel[this.treeColumnIndex].field;
2024
2048
  }
2025
- this.columnModel = [];
2026
2049
  var stackedHeader = false;
2027
2050
  var gridColumn;
2028
- for (var i = 0; i < gridColumns.length; i++) {
2029
- gridColumn = {};
2030
- for (var _i = 0, _a = Object.keys(gridColumns[i]); _i < _a.length; _i++) {
2031
- var prop = _a[_i];
2032
- gridColumn[prop] = gridColumns[i][prop];
2033
- }
2034
- this.columnModel.push(new Column(gridColumn));
2035
- if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
2036
- this.columnModel[i].template = temp;
2051
+ if (!this.enableColumnVirtualization || (this.enableColumnVirtualization && this.columnModel.length === gridColumns.length)) {
2052
+ this.columnModel = [];
2053
+ for (var i = 0; i < gridColumns.length; i++) {
2054
+ gridColumn = {};
2055
+ for (var _i = 0, _a = Object.keys(gridColumns[i]); _i < _a.length; _i++) {
2056
+ var prop = _a[_i];
2057
+ gridColumn[prop] = gridColumns[i][prop];
2058
+ }
2059
+ this.columnModel.push(new Column(gridColumn));
2060
+ if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
2061
+ this.columnModel[i].template = temp;
2062
+ }
2037
2063
  }
2038
2064
  }
2039
2065
  var merge = 'deepMerge';
@@ -2405,7 +2431,7 @@ var TreeGrid = /** @class */ (function (_super) {
2405
2431
  var row = getObject('rows', rec);
2406
2432
  var record = getObject('records', rec);
2407
2433
  for (var i = 0; i < record.length; i++) {
2408
- if (record[i].parentItem != undefined) {
2434
+ if (record[i].parentItem !== undefined) {
2409
2435
  var pindex = this.flatData[record[i].parentItem.index].index;
2410
2436
  if (this.flatData[pindex].expanded === false) {
2411
2437
  record.push(this.flatData[pindex]);
@@ -3370,6 +3396,9 @@ var TreeGrid = /** @class */ (function (_super) {
3370
3396
  __decorate([
3371
3397
  Property(false)
3372
3398
  ], TreeGrid.prototype, "enableVirtualization", void 0);
3399
+ __decorate([
3400
+ Property(false)
3401
+ ], TreeGrid.prototype, "enableColumnVirtualization", void 0);
3373
3402
  __decorate([
3374
3403
  Property(false)
3375
3404
  ], TreeGrid.prototype, "enableInfiniteScrolling", void 0);
@@ -96,7 +96,15 @@ var Render = /** @class */ (function () {
96
96
  else {
97
97
  index = data.index;
98
98
  }
99
- if (grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType
99
+ var columnIndex;
100
+ var getVirtualColIndexByUid = 'getVirtualColIndexByUid';
101
+ if (this.parent.enableColumnVirtualization && !this.parent.initialRender) {
102
+ columnIndex = this.parent[getVirtualColIndexByUid](args.column.uid);
103
+ }
104
+ else {
105
+ columnIndex = grid.getColumnIndexByUid(args.column.uid);
106
+ }
107
+ if (columnIndex === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType
100
108
  === 'rowDragAndDrop' || args.requestType === 'delete' || isNullOrUndefined(args.cell.querySelector('.e-treecell')))) {
101
109
  var container = createElement('div', { className: 'e-treecolumn-container' });
102
110
  var emptyExpandIcon = createElement('span', {
@@ -10,6 +10,7 @@ export declare class TreeVirtualRowModelGenerator extends VirtualRowModelGenerat
10
10
  constructor(parent: IGrid);
11
11
  addEventListener(): void;
12
12
  private getDatas;
13
+ private getDataInfo;
13
14
  generateRows(data: Object[], notifyArgs?: NotifyArgs): Row<Column>[];
14
15
  checkAndResetCache(action: string): boolean;
15
16
  }
@@ -34,7 +34,19 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
34
34
  TreeVirtualRowModelGenerator.prototype.getDatas = function (args) {
35
35
  this.visualData = args.data;
36
36
  };
37
+ TreeVirtualRowModelGenerator.prototype.getDataInfo = function () {
38
+ return _super.prototype.getData.call(this);
39
+ };
37
40
  TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
41
+ var info = this.getDataInfo();
42
+ if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
43
+ if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
44
+ notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
45
+ }
46
+ else {
47
+ notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
48
+ }
49
+ }
38
50
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
39
51
  && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
40
52
  return _super.prototype.generateRows.call(this, data, notifyArgs);
@@ -49,6 +49,7 @@ export declare class VirtualTreeContentRenderer extends VirtualContentRenderer {
49
49
  private restoreNewRow;
50
50
  private getData;
51
51
  private onActionComplete;
52
+ private onEnteredAction;
52
53
  scrollListeners(scrollArgs: ScrollArg): void;
53
54
  appendContent(target: HTMLElement, newChild: DocumentFragment, e: NotifyArgs): void;
54
55
  removeEventListener(): void;
@@ -58,7 +59,7 @@ export declare class TreeInterSectionObserver extends InterSectionObserver {
58
59
  private newPos;
59
60
  private lastPos;
60
61
  private timer;
61
- observes(callback: Function): void;
62
+ observes(callback: Function, onEnterCallback: Function): void;
62
63
  private clear;
63
64
  private virtualScrollHandlers;
64
65
  }