@syncfusion/ej2-treegrid 20.1.48 → 20.1.51

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.1.48
3
+ * version : 20.1.51
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@20.1.47",
3
+ "_id": "@syncfusion/ej2-treegrid@20.1.48",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-wi8XwhJB7KOHPpwl6tPNlqmE8HiFV+wPZHy+nOFvu2CL3/TQEqPhwz44h5EAuG+xRN6DqrOODGjf/R7DfWNAZA==",
5
+ "_integrity": "sha512-8wPx7RsFAoz5CZKwde0HxmCx1MYBUtZGrzI/e+at8zwvQlxMLvVJnhERqJFFhdPoZcdQga4D6tx0vGHCrfM/+Q==",
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-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.1.47.tgz",
28
- "_shasum": "4e9347d2be3329f13cd71967f9b245887b42f746",
27
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.1.48.tgz",
28
+ "_shasum": "e7bd8249c5a14245b20a6295bc7a8668f094da53",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
31
31
  "author": {
@@ -36,9 +36,9 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~20.1.48",
39
+ "@syncfusion/ej2-base": "~20.1.50",
40
40
  "@syncfusion/ej2-data": "~20.1.47",
41
- "@syncfusion/ej2-grids": "~20.1.48",
41
+ "@syncfusion/ej2-grids": "~20.1.51",
42
42
  "@syncfusion/ej2-popups": "~20.1.47"
43
43
  },
44
44
  "deprecated": false,
@@ -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": "20.1.48",
63
+ "version": "20.1.51",
64
64
  "sideEffects": false
65
65
  }
@@ -486,7 +486,7 @@ var BatchEdit = /** @class */ (function () {
486
486
  if (this.parent.editSettings.newRowPosition !== 'Bottom' && !Object.hasOwnProperty.call(args, 'updatedRecords')) {
487
487
  data.splice(data.length - addRecords.length, addRecords.length);
488
488
  if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {
489
- var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[0].ariaRowIndex);
489
+ var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[0].getAttribute('aria-rowindex'), 10);
490
490
  data.splice(index_1, 0, addRecords[0]);
491
491
  }
492
492
  if (!this.parent.allowPaging && data.length !== currentViewRecords.length) {
@@ -366,7 +366,12 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
366
366
  control.grid.setRowData(key, record);
367
367
  var row = control.getRowByIndex(index_1);
368
368
  if (control.editSettings.mode === 'Batch') {
369
- row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[key])];
369
+ if (action === 'add') {
370
+ row = control.getRows()[control.grid.getCurrentViewRecords().indexOf(record)];
371
+ }
372
+ else {
373
+ row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[key])];
374
+ }
370
375
  }
371
376
  var movableRow = void 0;
372
377
  if (control.frozenRows || control.getFrozenColumns()) {
@@ -682,7 +682,7 @@ var Edit = /** @class */ (function () {
682
682
  this.selectedIndex = this.batchEditModule.getSelectedIndex();
683
683
  if (this.parent.editModule['isAddedRowByMethod']) {
684
684
  var args = {
685
- action: "add",
685
+ action: 'add',
686
686
  data: this.parent.getBatchChanges()['addedRecords'][0],
687
687
  index: index,
688
688
  seletedRow: 0
@@ -836,7 +836,7 @@ var Edit = /** @class */ (function () {
836
836
  var parentIdMapping = void 0;
837
837
  var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
838
838
  var rows = this.parent.getRows();
839
- var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;
839
+ var firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
840
840
  var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
841
841
  var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
842
842
  if (currentData.length) {
@@ -24,9 +24,19 @@ export declare class RowDD {
24
24
  /** @hidden */
25
25
  isMultipleGrid: string;
26
26
  /** @hidden */
27
+ private modifiedRecords;
28
+ /** @hidden */
29
+ private selectedItem;
30
+ /** @hidden */
31
+ private selectedRecords;
32
+ /** @hidden */
33
+ private selectedRows;
34
+ /** @hidden */
27
35
  private hasDropItem;
28
36
  /** @hidden */
29
37
  isaddtoBottom: boolean;
38
+ private selectedRecord;
39
+ private selectedRow;
30
40
  /**
31
41
  * Constructor for render module
32
42
  *
@@ -48,6 +58,8 @@ export declare class RowDD {
48
58
  * @param {string} position - Drop position as above or below or child
49
59
  */
50
60
  reorderRows(fromIndexes: number[], toIndex: number, position: string): void;
61
+ private indentOutdentAction;
62
+ private eventTrigger;
51
63
  private orderToIndex;
52
64
  private rowsAdded;
53
65
  private rowsRemoved;
@@ -78,6 +90,7 @@ export declare class RowDD {
78
90
  private updateChildRecord;
79
91
  private updateChildRecordLevel;
80
92
  private removeRecords;
93
+ private updateModifiedRecords;
81
94
  private removeChildItem;
82
95
  private getChildCount;
83
96
  private ensuredropPosition;
@@ -22,6 +22,12 @@ var RowDD = /** @class */ (function () {
22
22
  /** @hidden */
23
23
  this.isDraggedWithChild = false;
24
24
  /** @hidden */
25
+ this.modifiedRecords = 'modifiedRecords';
26
+ /** @hidden */
27
+ this.selectedRecords = 'selectedRecords';
28
+ /** @hidden */
29
+ this.selectedRows = 'selectedRows';
30
+ /** @hidden */
25
31
  this.hasDropItem = true;
26
32
  /** @hidden */
27
33
  this.isaddtoBottom = false;
@@ -63,6 +69,7 @@ var RowDD = /** @class */ (function () {
63
69
  RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {
64
70
  var tObj = this.parent;
65
71
  var action = 'action';
72
+ var dropPosition = 'dropPosition';
66
73
  var updateRowAndCellElements = 'updateRowAndCellElements';
67
74
  if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
68
75
  if (position === 'above') {
@@ -74,6 +81,7 @@ var RowDD = /** @class */ (function () {
74
81
  if (position === 'child') {
75
82
  this.dropPosition = 'middleSegment';
76
83
  }
84
+ this.parent[dropPosition] = this.dropPosition;
77
85
  var data = [];
78
86
  for (var i = 0; i < fromIndexes.length; i++) {
79
87
  data[i] = this.parent.getCurrentViewRecords()[fromIndexes[i]];
@@ -138,6 +146,89 @@ var RowDD = /** @class */ (function () {
138
146
  return;
139
147
  }
140
148
  };
149
+ RowDD.prototype.indentOutdentAction = function (record, request) {
150
+ var tObj = this.parent;
151
+ var action = 'action';
152
+ var droppedIndex = 'dropIndex';
153
+ var selectedItemIndex = -1;
154
+ if (isNullOrUndefined(record) && this.parent.selectedRowIndex === -1) {
155
+ return;
156
+ }
157
+ else {
158
+ if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {
159
+ selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;
160
+ }
161
+ else if (this.parent.selectedRowIndex !== -1) {
162
+ selectedItemIndex = this.parent.selectedRowIndex;
163
+ }
164
+ this.selectedItem = isNullOrUndefined(record) ?
165
+ tObj.getCurrentViewRecords()[selectedItemIndex] : record;
166
+ var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
167
+ var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[primaryKeyField]);
168
+ this.selectedRow = this.parent[this.selectedRows] = selectedItemIndex !== -1 ?
169
+ this.parent.getSelectedRows()[0]
170
+ : this.parent.grid.getRowByIndex(rowIndex);
171
+ this.selectedRecord = this.parent[this.selectedRecords] = selectedItemIndex !== -1 ?
172
+ tObj.getCurrentViewRecords()[selectedItemIndex]
173
+ : this.selectedItem;
174
+ if (request === 'indent') {
175
+ var record_1 = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex - 1];
176
+ var dropIndex = void 0;
177
+ if (this.selectedRow.rowIndex === 0 || this.selectedRow.rowIndex === -1 ||
178
+ tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level - record_1.level === 1) {
179
+ return;
180
+ }
181
+ if (record_1.level > this.selectedRecord.level) {
182
+ for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
183
+ if (tObj.getCurrentViewRecords()[i].taskData === record_1.parentItem.taskData) {
184
+ dropIndex = i;
185
+ }
186
+ }
187
+ }
188
+ else {
189
+ dropIndex = this.selectedRow.rowIndex - 1;
190
+ }
191
+ tObj[action] = 'indenting';
192
+ tObj[droppedIndex] = dropIndex;
193
+ this.eventTrigger('indenting', dropIndex);
194
+ }
195
+ else if (request === 'outdent') {
196
+ if (this.selectedRow.rowIndex === -1 || this.selectedRow.rowIndex === 0 ||
197
+ tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level === 0) {
198
+ return;
199
+ }
200
+ var dropIndex = void 0;
201
+ var parentItem = this.selectedRecord.parentItem;
202
+ for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
203
+ if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {
204
+ dropIndex = i;
205
+ }
206
+ }
207
+ tObj[action] = 'outdenting';
208
+ tObj[droppedIndex] = dropIndex;
209
+ this.eventTrigger('outdenting', dropIndex);
210
+ }
211
+ }
212
+ };
213
+ RowDD.prototype.eventTrigger = function (action, dropIndex) {
214
+ var _this = this;
215
+ var actionArgs = {
216
+ action: action,
217
+ cancel: false,
218
+ data: [this.parent[this.selectedRecords]],
219
+ row: this.parent[this.selectedRows]
220
+ };
221
+ this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {
222
+ if (!actionArgs.cancel) {
223
+ if (actionArgs.action === 'indenting') {
224
+ _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'child');
225
+ }
226
+ else if (actionArgs.action === 'outdenting') {
227
+ _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'below');
228
+ }
229
+ }
230
+ });
231
+ };
141
232
  RowDD.prototype.orderToIndex = function (currentData) {
142
233
  for (var i = 0; i < currentData.length; i++) {
143
234
  currentData[i].index = i;
@@ -203,7 +294,8 @@ var RowDD = /** @class */ (function () {
203
294
  }
204
295
  }
205
296
  }
206
- if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.parentIdMapping) && draggedRecord_1[tObj.parentIdMapping] != null
297
+ if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.parentIdMapping)
298
+ && draggedRecord_1[tObj.parentIdMapping] !== null
207
299
  && !this.isDraggedWithChild) {
208
300
  draggedRecord_1.taskData[tObj.parentIdMapping] = null;
209
301
  delete draggedRecord_1.parentItem;
@@ -695,7 +787,7 @@ var RowDD = /** @class */ (function () {
695
787
  indexes[i] = records[i].index;
696
788
  }
697
789
  var data = srcControl.dataSource;
698
- if (this.parent.idMapping != null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {
790
+ if (this.parent.idMapping !== null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {
699
791
  var actualData = [];
700
792
  for (var i = 0; i < records.length; i++) {
701
793
  if (records[i].hasChildRecords) {
@@ -743,14 +835,25 @@ var RowDD = /** @class */ (function () {
743
835
  RowDD.prototype.getTargetIdx = function (targetRow) {
744
836
  return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) : 0;
745
837
  };
746
- RowDD.prototype.getParentData = function (record) {
838
+ RowDD.prototype.getParentData = function (record, data) {
747
839
  var parentItem = record.parentItem;
840
+ var selectedItemIndex = -1;
841
+ if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {
842
+ selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;
843
+ }
844
+ else if (this.parent.selectedRowIndex !== -1) {
845
+ selectedItemIndex = this.parent.selectedRowIndex;
846
+ }
748
847
  if (this.dropPosition === 'bottomSegment') {
749
- var selectedRecord = this.parent.getSelectedRecords()[0];
848
+ var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
849
+ var rowIndex = selectedItemIndex === -1 ?
850
+ (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField])) - 1
851
+ : this.parent.getSelectedRowIndexes()[0] - 1;
852
+ var selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];
750
853
  this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
751
854
  }
752
855
  if (this.dropPosition === 'middleSegment') {
753
- var level = this.parent.getSelectedRecords()[0].level;
856
+ var level = this.parent.getCurrentViewRecords()[selectedItemIndex].level;
754
857
  if (level === parentItem.level) {
755
858
  this.droppedRecord = getParentData(this.parent, parentItem.uniqueID);
756
859
  }
@@ -765,9 +868,12 @@ var RowDD = /** @class */ (function () {
765
868
  var draggedRecord_2;
766
869
  var droppedRecord = void 0;
767
870
  if (isNullOrUndefined(args.dropIndex)) {
768
- var rowIndex = tObj.getSelectedRowIndexes()[0] - 1;
871
+ var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
872
+ var rowIndex = tObj.selectedRowIndex === -1 ?
873
+ (this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField])) - 1
874
+ : tObj.getSelectedRowIndexes()[0] - 1;
769
875
  var record = tObj.getCurrentViewRecords()[rowIndex];
770
- this.getParentData(record);
876
+ this.getParentData(record, args.data);
771
877
  }
772
878
  else {
773
879
  args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;
@@ -781,6 +887,7 @@ var RowDD = /** @class */ (function () {
781
887
  else {
782
888
  dragRecords = args.data;
783
889
  }
890
+ this.parent[this.modifiedRecords].push(args.data[0], droppedRecord);
784
891
  var count = 0;
785
892
  var multiplegrid = this.parent.rowDropSettings.targetID;
786
893
  this.isMultipleGrid = multiplegrid;
@@ -1103,6 +1210,19 @@ var RowDD = /** @class */ (function () {
1103
1210
  flatParentData.hasChildRecords = false;
1104
1211
  flatParentData.hasFilteredChildRecords = false;
1105
1212
  }
1213
+ if (this.parent[this.modifiedRecords].indexOf(flatParentData) === -1 && !isNullOrUndefined(flatParentData)) {
1214
+ this.parent[this.modifiedRecords].push(flatParentData);
1215
+ }
1216
+ if (!isNullOrUndefined(flatParentData)) {
1217
+ this.updateModifiedRecords(flatParentData);
1218
+ }
1219
+ }
1220
+ };
1221
+ RowDD.prototype.updateModifiedRecords = function (record) {
1222
+ var parentData = getParentData(this.parent, record.parentUniqueID);
1223
+ if (!isNullOrUndefined(parentData)) {
1224
+ this.parent[this.modifiedRecords].push(parentData);
1225
+ this.updateModifiedRecords(parentData);
1106
1226
  }
1107
1227
  };
1108
1228
  RowDD.prototype.removeChildItem = function (record) {
@@ -26,7 +26,6 @@ export declare class Toolbar {
26
26
  removeEventListener(): void;
27
27
  private refreshToolbar;
28
28
  private toolbarClickHandler;
29
- private eventTrigger;
30
29
  /**
31
30
  * Gets the toolbar of the TreeGrid.
32
31
  *
@@ -44,46 +44,59 @@ var Toolbar = /** @class */ (function () {
44
44
  };
45
45
  Toolbar.prototype.refreshToolbar = function (args) {
46
46
  var tObj = this.parent;
47
- if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {
48
- this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);
47
+ var indentElement;
48
+ var outdentElement;
49
+ var indentID = tObj.element.id + '_gridcontrol_indent';
50
+ var outdentID = tObj.element.id + '_gridcontrol_outdent';
51
+ var toolbarElement = this.parent.grid.toolbarModule.getToolbar();
52
+ var indentEle = toolbarElement.querySelector('#' + indentID);
53
+ var outdentEle = toolbarElement.querySelector('#' + outdentID);
54
+ var row = args.row;
55
+ var selectedrow = tObj.getSelectedRows()[0];
56
+ if (!isNullOrUndefined(row[0])) {
57
+ row = row[0];
49
58
  }
50
- else if (args['name'] !== 'rowDeselected') {
51
- if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {
52
- if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&
53
- (tObj.getCurrentViewRecords()[args.row.rowIndex].level >
54
- tObj.getCurrentViewRecords()[args.row.rowIndex - 1].level)) {
55
- this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
56
- }
57
- else {
58
- this.enableItems([tObj.element.id + '_gridcontrol_indent'], true);
59
- }
60
- if (tObj.getCurrentViewRecords()[args.row.rowIndex].level ===
61
- tObj.getCurrentViewRecords()[args.row.rowIndex - 1].level) {
62
- this.enableItems([tObj.element.id + '_gridcontrol_indent'], true);
59
+ row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
60
+ if (indentEle !== null && outdentEle !== null) {
61
+ indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
62
+ outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
63
+ if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
64
+ indentElement.classList.add('e-hidden');
65
+ outdentElement.classList.add('e-hidden');
66
+ }
67
+ else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
68
+ var selectedItem = tObj.getCurrentViewRecords()[row.rowIndex];
69
+ if (!isNullOrUndefined(selectedItem)) {
70
+ if ((selectedItem.level > tObj.getCurrentViewRecords()[row.rowIndex - 1].level)) {
71
+ indentElement.classList.add('e-hidden');
72
+ }
73
+ else {
74
+ indentElement.classList.remove('e-hidden');
75
+ }
76
+ if (selectedItem.level === tObj.getCurrentViewRecords()[row.rowIndex - 1].level) {
77
+ indentElement.classList.remove('e-hidden');
78
+ }
79
+ if (selectedItem.level === 0) {
80
+ outdentElement.classList.add('e-hidden');
81
+ }
82
+ if (selectedItem.level !== 0) {
83
+ outdentElement.classList.remove('e-hidden');
84
+ }
63
85
  }
64
- if (tObj.getCurrentViewRecords()[args.row.rowIndex].level === 0) {
65
- this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);
86
+ }
87
+ if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
88
+ if (this.parent.toolbar['includes']('Indent')) {
89
+ indentElement.classList.add('e-hidden');
66
90
  }
67
- if (tObj.getCurrentViewRecords()[args.row.rowIndex].level !== 0) {
68
- this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);
91
+ if (this.parent.toolbar['includes']('Outdent')) {
92
+ outdentElement.classList.add('e-hidden');
69
93
  }
70
94
  }
71
95
  }
72
- if (args['name'] === 'rowDeselected') {
73
- if (this.parent.toolbar['includes']('Indent')) {
74
- this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
75
- }
76
- if (this.parent.toolbar['includes']('Outdent')) {
77
- this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);
78
- }
79
- }
80
- if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {
81
- this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);
82
- }
83
96
  };
84
97
  Toolbar.prototype.toolbarClickHandler = function (args) {
85
98
  var tObj = this.parent;
86
- var action = 'action';
99
+ var indentOutdentAction = 'indentOutdentAction';
87
100
  if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.editSettings.mode === 'Batch' &&
88
101
  args.item.id === this.parent.grid.element.id + '_update') {
89
102
  args.cancel = true;
@@ -95,57 +108,15 @@ var Toolbar = /** @class */ (function () {
95
108
  if (args.item.id === this.parent.grid.element.id + '_collapseall') {
96
109
  this.parent.collapseAll();
97
110
  }
98
- if (args.item.id === tObj.grid.element.id + '_indent' && tObj.getSelectedRecords().length) {
99
- var record = tObj.getCurrentViewRecords()[tObj.getSelectedRowIndexes()[0] - 1];
100
- var dropIndex = void 0;
101
- if (record.level > tObj.getSelectedRecords()[0].level) {
102
- for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
103
- if (tObj.getCurrentViewRecords()[i].taskData === record.parentItem.taskData) {
104
- dropIndex = i;
105
- }
106
- }
107
- }
108
- else {
109
- dropIndex = tObj.getSelectedRowIndexes()[0] - 1;
110
- }
111
- this.parent[action] = 'indenting';
112
- this.eventTrigger('indenting', dropIndex);
111
+ if (args.item.id === tObj.grid.element.id + '_indent' && tObj.getSelectedRecords().length
112
+ && !isNullOrUndefined(tObj.rowDragAndDropModule)) {
113
+ this.parent.rowDragAndDropModule[indentOutdentAction](null, 'indent');
113
114
  }
114
- if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length) {
115
- var dropIndex = void 0;
116
- var parentItem = tObj.getSelectedRecords()[0].parentItem;
117
- for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
118
- if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {
119
- dropIndex = i;
120
- }
121
- }
122
- this.parent[action] = 'outdenting';
123
- this.eventTrigger('outdenting', dropIndex);
115
+ if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length
116
+ && !isNullOrUndefined(tObj.rowDragAndDropModule)) {
117
+ this.parent.rowDragAndDropModule[indentOutdentAction](null, 'outdent');
124
118
  }
125
119
  };
126
- Toolbar.prototype.eventTrigger = function (action, dropIndex) {
127
- var _this = this;
128
- var selectedRecords = 'selectedRecords';
129
- var selectedRows = 'selectedRows';
130
- this.parent[selectedRows] = this.parent.getSelectedRows();
131
- this.parent[selectedRecords] = this.parent.getSelectedRecords();
132
- var actionArgs = {
133
- requestType: action,
134
- data: this.parent.getSelectedRecords(),
135
- row: this.parent.getSelectedRows(),
136
- cancel: false
137
- };
138
- this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {
139
- if (!actionArgs.cancel) {
140
- if (actionArgs.requestType === 'indenting') {
141
- _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');
142
- }
143
- else if (actionArgs.requestType === 'outdenting') {
144
- _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');
145
- }
146
- }
147
- });
148
- };
149
120
  /**
150
121
  * Gets the toolbar of the TreeGrid.
151
122
  *
@@ -117,7 +117,7 @@ var VirtualScroll = /** @class */ (function () {
117
117
  }
118
118
  else {
119
119
  var requestType = pageingDetails.actionArgs.requestType;
120
- if (requestType === 'filtering' || requestType === 'collapseAll' ||
120
+ if (requestType === 'filtering' || requestType === 'collapseAll' || requestType === 'searching' ||
121
121
  (requestType === 'refresh' && this.parent.enableCollapseAll && endIndex > visualData.length)) {
122
122
  startIndex = 0;
123
123
  endIndex = this.parent.grid.pageSettings.pageSize - 1;
@@ -82,11 +82,16 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
82
82
  private addedRecords;
83
83
  private targetElement;
84
84
  private isGantt;
85
+ private isIndentEnabled;
86
+ private indentOutdentAction;
85
87
  /**
86
88
  * The `sortModule` is used to manipulate sorting in TreeGrid.
87
89
  */
88
90
  sortModule: Sort;
89
91
  private action;
92
+ private dropIndex;
93
+ private dropPosition;
94
+ private modifiedRecords;
90
95
  private selectedRecords;
91
96
  private selectedRows;
92
97
  private loggerModule;
@@ -1211,6 +1216,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1211
1216
  * @returns {void}
1212
1217
  */
1213
1218
  protected render(): void;
1219
+ private refreshToolbarItems;
1214
1220
  private afterGridRender;
1215
1221
  private convertTreeData;
1216
1222
  private bindGridProperties;
@@ -2015,6 +2021,20 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
2015
2021
  * @returns {void}
2016
2022
  */
2017
2023
  reorderRows(fromIndexes: number[], toIndex: number, position: string): void;
2024
+ /**
2025
+ * Indents the record to one level of hierarchy. Moves the selected row as the last child of its previous row.
2026
+ *
2027
+ * @param {Object} record – specifies the record to do indented
2028
+ * @returns {void}
2029
+ */
2030
+ indent(record?: Object): void;
2031
+ /**
2032
+ * Outdent the record to one level of hierarchy. Moves the selected row as sibling to its parent row.
2033
+ *
2034
+ * @param {Object} record – specifies the record to do outdented
2035
+ * @returns {void}
2036
+ */
2037
+ outdent(record?: Object): void;
2018
2038
  /**
2019
2039
  * `columnchooserModule` is used to dynamically show or hide the TreeGrid columns.
2020
2040
  *