@syncfusion/ej2-treegrid 20.1.55 → 20.1.60

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.
@@ -77,12 +77,12 @@ class Column {
77
77
  merge(this, options);
78
78
  }
79
79
  /**
80
- * Update the State changes reflected for TreeGrid columndirective in react platform.
81
- *
82
- * @param {Column} column - specifies the column
83
- * @returns {void}
84
- * @hidden
85
- */
80
+ * Update the State changes reflected for TreeGrid columndirective in react platform.
81
+ *
82
+ * @param {Column} column - specifies the column
83
+ * @returns {void}
84
+ * @hidden
85
+ */
86
86
  setProperties(column) {
87
87
  //Angular two way binding
88
88
  const keys = Object.keys(column);
@@ -884,7 +884,7 @@ class Selection {
884
884
  getCheckboxcolumnIndex() {
885
885
  let mappingUid;
886
886
  let columnIndex;
887
- const stackedHeader = "stackedHeader";
887
+ const stackedHeader = 'stackedHeader';
888
888
  const columnModel = 'columnModel';
889
889
  const columns = this.parent[stackedHeader] ? this.parent[columnModel] : (this.parent.columns);
890
890
  for (let col = 0; col < columns.length; col++) {
@@ -1271,6 +1271,100 @@ class Selection {
1271
1271
  }
1272
1272
  }
1273
1273
 
1274
+ /**
1275
+ * TreeGrid Freeze module
1276
+ *
1277
+ * @hidden
1278
+ */
1279
+ class Freeze$1 {
1280
+ /**
1281
+ * Constructor for render module
1282
+ *
1283
+ * @param {TreeGrid} parent - Tree Grid instance
1284
+ */
1285
+ constructor(parent) {
1286
+ Grid.Inject(Freeze);
1287
+ this.parent = parent;
1288
+ this.addEventListener();
1289
+ }
1290
+ addEventListener() {
1291
+ this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
1292
+ this.parent.on('dataBoundArg', this.dataBoundArg, this);
1293
+ this.parent.grid.on('dblclick', this.dblClickHandler, this);
1294
+ }
1295
+ removeEventListener() {
1296
+ if (this.parent.isDestroyed) {
1297
+ return;
1298
+ }
1299
+ this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
1300
+ this.parent.off('dataBoundArg', this.dataBoundArg);
1301
+ this.parent.grid.off('dblclick', this.dblClickHandler);
1302
+ }
1303
+ rowExpandCollapse(args) {
1304
+ const movableRows = this.parent.getMovableDataRows();
1305
+ const frozenrows = this.parent.getRows();
1306
+ let rows;
1307
+ let frozenRightRows;
1308
+ const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
1309
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
1310
+ if (freeze) {
1311
+ frozenRightRows = this.parent.getFrozenRightRows().filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
1312
+ }
1313
+ if (!args.detailrows.length) {
1314
+ rows = movableRows.filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
1315
+ }
1316
+ else {
1317
+ rows = args.detailrows;
1318
+ }
1319
+ for (let i = 0; i < rows.length; i++) {
1320
+ const rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
1321
+ rows[i].style.display = args.action;
1322
+ if (freeze) {
1323
+ frozenRightRows[i].style.display = args.action;
1324
+ }
1325
+ const queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
1326
+ : '.e-treecolumn-container .e-treegridexpand';
1327
+ if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {
1328
+ const cRow = [];
1329
+ for (let i = 0; i < movableRows.length; i++) {
1330
+ if (movableRows[i].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {
1331
+ cRow.push(movableRows[i]);
1332
+ }
1333
+ }
1334
+ if (cRow.length) {
1335
+ this.rowExpandCollapse({ detailrows: cRow, action: args.action });
1336
+ }
1337
+ }
1338
+ }
1339
+ }
1340
+ dblClickHandler(e) {
1341
+ if (parentsUntil(e.target, 'e-rowcell') &&
1342
+ this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
1343
+ this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
1344
+ }
1345
+ }
1346
+ dataBoundArg() {
1347
+ const checkboxColumn = this.parent.getColumns().filter((e) => {
1348
+ return e.showCheckbox;
1349
+ });
1350
+ if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {
1351
+ addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');
1352
+ }
1353
+ }
1354
+ destroy() {
1355
+ this.removeEventListener();
1356
+ }
1357
+ /**
1358
+ * For internal use only - Get the module name.
1359
+ *
1360
+ * @private
1361
+ * @returns {string} Returns Freeze module name
1362
+ */
1363
+ getModuleName() {
1364
+ return 'freeze';
1365
+ }
1366
+ }
1367
+
1274
1368
  /**
1275
1369
  * TreeGrid Print module
1276
1370
  *
@@ -1661,10 +1755,10 @@ class Render {
1661
1755
  }
1662
1756
  }
1663
1757
  /**
1664
- * @param {string} columnUid - Defines column uid
1665
- * @returns {void}
1666
- * @hidden
1667
- */
1758
+ * @param {string} columnUid - Defines column uid
1759
+ * @returns {void}
1760
+ * @hidden
1761
+ */
1668
1762
  refreshReactColumnTemplateByUid(columnUid) {
1669
1763
  if (this.parent.isReact) {
1670
1764
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1680,6 +1774,8 @@ class Render {
1680
1774
  const cellRenderer = new CellRenderer(this.parent.grid, this.parent.grid.serviceLocator);
1681
1775
  const td = this.parent.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
1682
1776
  cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
1777
+ const treecell = this.parent.getRows()[j].cells[cellIndex];
1778
+ this.cellRender({ data: rowsObj[j].data, cell: treecell, column: cell.column });
1683
1779
  }
1684
1780
  }
1685
1781
  });
@@ -2335,6 +2431,8 @@ var ContextMenuItems;
2335
2431
  ContextMenuItems[ContextMenuItems["LastPage"] = 13] = "LastPage";
2336
2432
  ContextMenuItems[ContextMenuItems["NextPage"] = 14] = "NextPage";
2337
2433
  ContextMenuItems[ContextMenuItems["AddRow"] = 15] = "AddRow";
2434
+ ContextMenuItems[ContextMenuItems["RowIndent"] = 16] = "RowIndent";
2435
+ ContextMenuItems[ContextMenuItems["RowOutdent"] = 17] = "RowOutdent";
2338
2436
  })(ContextMenuItems || (ContextMenuItems = {}));
2339
2437
 
2340
2438
  var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -3315,6 +3413,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3315
3413
  requiredModules() {
3316
3414
  const modules = [];
3317
3415
  const splitFrozenCount = 'splitFrozenCount';
3416
+ this.freezeModule = new Freeze$1(this);
3318
3417
  this.grid[splitFrozenCount](this.getGridColumns(this.columns));
3319
3418
  if (this.isDestroyed) {
3320
3419
  return modules;
@@ -3366,7 +3465,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3366
3465
  });
3367
3466
  }
3368
3467
  if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
3369
- this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
3468
+ this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || this.freezeModule) {
3370
3469
  modules.push({
3371
3470
  member: 'freeze', args: [this]
3372
3471
  });
@@ -3396,7 +3495,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3396
3495
  }
3397
3496
  extendRequiredModules(modules) {
3398
3497
  const IsRowDDInjected = this.injectedModules.filter((e) => {
3399
- return e.name === 'RowDD';
3498
+ return e.prototype.getModuleName() === 'rowDragAndDrop';
3400
3499
  });
3401
3500
  if (this.allowRowDragAndDrop || IsRowDDInjected.length) {
3402
3501
  if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||
@@ -4199,6 +4298,16 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4199
4298
  target: '.e-content', id: this.element.id + '_gridcontrol_cmenu_AddRow',
4200
4299
  items: [{ text: this.l10n.getConstant('Above'), id: 'Above' }, { text: this.l10n.getConstant('Below'), id: 'Below' }, { text: this.l10n.getConstant('Child'), id: 'Child' }] });
4201
4300
  break;
4301
+ case 'Indent':
4302
+ case ContextMenuItems.RowIndent:
4303
+ items.push({ text: this.l10n.getConstant('RowIndent'),
4304
+ target: '.e-content', iconCss: 'e-indent e-icons', id: this.element.id + '_gridcontrol_cmenu_Indent' });
4305
+ break;
4306
+ case 'Outdent':
4307
+ case ContextMenuItems.RowOutdent:
4308
+ items.push({ text: this.l10n.getConstant('RowOutdent'),
4309
+ target: '.e-content', iconCss: 'e-outdent e-icons', id: this.element.id + '_gridcontrol_cmenu_Outdent' });
4310
+ break;
4202
4311
  default:
4203
4312
  items.push(this.contextMenuItems[i]);
4204
4313
  }
@@ -4217,6 +4326,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4217
4326
  */
4218
4327
  getGridToolbar() {
4219
4328
  if (this.toolbar) {
4329
+ this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);
4220
4330
  const items = [];
4221
4331
  let tooltipText;
4222
4332
  for (let i = 0; i < this.toolbar.length; i++) {
@@ -4295,6 +4405,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4295
4405
  gridColumn[prop] = this.getGridColumns(column[i][prop], false, index);
4296
4406
  treeGridColumn[prop] = column[i][prop];
4297
4407
  }
4408
+ else if (this.initialRender && !isNullOrUndefined(treeColumn) && this.enablePersistence && prop === 'edit') {
4409
+ gridColumn[prop] = treeGridColumn[prop] = treeColumn[prop];
4410
+ }
4298
4411
  else if (!(treeColumn) || prop !== 'sortComparer') {
4299
4412
  gridColumn[prop] = treeGridColumn[prop] = column[i][prop];
4300
4413
  }
@@ -4458,6 +4571,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4458
4571
  break;
4459
4572
  case 'locale':
4460
4573
  this.grid.locale = this.locale;
4574
+ this.TreeGridLocale();
4575
+ this.grid.toolbar = this.getGridToolbar();
4576
+ this.grid.contextMenuItems = this.getContextMenu();
4461
4577
  break;
4462
4578
  case 'selectedRowIndex':
4463
4579
  this.grid.selectedRowIndex = this.selectedRowIndex;
@@ -7730,8 +7846,8 @@ class RowDD$1 {
7730
7846
  if (this.dropPosition === 'bottomSegment') {
7731
7847
  const primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
7732
7848
  const rowIndex = selectedItemIndex === -1 ?
7733
- (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField])) - 1
7734
- : this.parent.getSelectedRowIndexes()[0] - 1;
7849
+ (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField]))
7850
+ : this.parent.getSelectedRowIndexes()[0];
7735
7851
  const selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];
7736
7852
  this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
7737
7853
  }
@@ -9040,6 +9156,16 @@ class Page$1 {
9040
9156
  }
9041
9157
  return newResults;
9042
9158
  }
9159
+ updatePageSize(pageingDetails) {
9160
+ const updateSize = pageingDetails.result.length;
9161
+ const gridPagerModule = this.parent.grid.pagerModule;
9162
+ if (this.parent.pageSettings.pageSizes === true) {
9163
+ if (gridPagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === gridPagerModule.pagerObj.getLocalizedLabel('All')) {
9164
+ gridPagerModule['pagerObj'].totalRecordsCount = updateSize;
9165
+ this.parent.grid.pageSettings.pageSize = updateSize;
9166
+ }
9167
+ }
9168
+ }
9043
9169
  pageAction(pageingDetails) {
9044
9170
  const dm = new DataManager(pageingDetails.result);
9045
9171
  if (this.parent.pageSettings.pageSizeMode === 'Root') {
@@ -9075,6 +9201,7 @@ class Page$1 {
9075
9201
  pageingDetails.count = visualData.length;
9076
9202
  let query = new Query();
9077
9203
  const size = this.parent.grid.pageSettings.pageSize;
9204
+ this.updatePageSize(pageingDetails);
9078
9205
  let current = this.parent.grid.pageSettings.currentPage;
9079
9206
  if (visualData.length < (current * size)) {
9080
9207
  current = (Math.floor(visualData.length / size)) + ((visualData.length % size) ? 1 : 0);
@@ -9653,6 +9780,8 @@ class ContextMenu$1 {
9653
9780
  contextMenuOpen(args) {
9654
9781
  const addRow = select('#' + this.parent.element.id + '_gridcontrol_cmenu_AddRow', args.element);
9655
9782
  const editRecord = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Edit', args.element);
9783
+ const indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);
9784
+ const outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);
9656
9785
  if (addRow) {
9657
9786
  if (this.parent.grid.editSettings.allowAdding === false) {
9658
9787
  addRow.style.display = 'none';
@@ -9665,6 +9794,47 @@ class ContextMenu$1 {
9665
9794
  && !(isNullOrUndefined(editRecord)) && !(editRecord.classList.contains('e-menu-hide'))) {
9666
9795
  editRecord.style.display = 'none';
9667
9796
  }
9797
+ if (indent || outdent) {
9798
+ const tObj = this.parent;
9799
+ const selectedrow = tObj.getSelectedRows()[0];
9800
+ const targetElement = args.event.target.closest('td');
9801
+ if (isNullOrUndefined(targetElement) || (!isNullOrUndefined(targetElement) && !targetElement.classList.contains('e-rowcell'))) {
9802
+ indent.style.display = outdent.style.display = 'none';
9803
+ }
9804
+ else {
9805
+ if (selectedrow.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
9806
+ indent.style.display = outdent.style.display = 'none';
9807
+ }
9808
+ else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
9809
+ const selectedItem = tObj.getCurrentViewRecords()[selectedrow.rowIndex];
9810
+ if (!isNullOrUndefined(selectedItem)) {
9811
+ if ((selectedItem.level > tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level)) {
9812
+ indent.style.display = 'none';
9813
+ }
9814
+ else {
9815
+ indent.style.display = 'block';
9816
+ }
9817
+ if (selectedItem.level === tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level) {
9818
+ indent.style.display = 'block';
9819
+ }
9820
+ if (selectedItem.level === 0) {
9821
+ outdent.style.display = 'none';
9822
+ }
9823
+ if (selectedItem.level !== 0) {
9824
+ outdent.style.display = 'block';
9825
+ }
9826
+ }
9827
+ }
9828
+ if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
9829
+ if (this.parent.toolbar['includes']('Indent')) {
9830
+ indent.style.display = 'none';
9831
+ }
9832
+ if (this.parent.toolbar['includes']('Outdent')) {
9833
+ outdent.style.display = 'none';
9834
+ }
9835
+ }
9836
+ }
9837
+ }
9668
9838
  }
9669
9839
  contextMenuClick(args) {
9670
9840
  if (args.item.id === 'Above' || args.item.id === 'Below' || args.item.id === 'Child') {
@@ -9672,6 +9842,13 @@ class ContextMenu$1 {
9672
9842
  this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);
9673
9843
  this.parent.addRecord();
9674
9844
  }
9845
+ if (args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' || args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Outdent') {
9846
+ if (!isNullOrUndefined(this.parent.rowDragAndDropModule)) {
9847
+ const indentOutdentAction = 'indentOutdentAction';
9848
+ const action = args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' ? 'indent' : 'outdent';
9849
+ this.parent.rowDragAndDropModule[indentOutdentAction](null, action);
9850
+ }
9851
+ }
9675
9852
  }
9676
9853
  /**
9677
9854
  * For internal use only - Get the module name.
@@ -10842,11 +11019,13 @@ class Edit$1 {
10842
11019
  updateIndex(data, rows, records) {
10843
11020
  for (let j = 0; j < this.parent.getDataRows().length; j++) {
10844
11021
  const data1 = records[j];
10845
- const index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);
10846
- data1.index = index;
10847
- if (!isNullOrUndefined(data1.parentItem)) {
10848
- const parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);
10849
- data1.parentItem.index = parentIndex;
11022
+ if (!isNullOrUndefined(data1)) {
11023
+ const index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);
11024
+ data1.index = index;
11025
+ if (!isNullOrUndefined(data1.parentItem)) {
11026
+ const parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);
11027
+ data1.parentItem.index = parentIndex;
11028
+ }
10850
11029
  }
10851
11030
  }
10852
11031
  let count = -1;
@@ -10865,32 +11044,34 @@ class Edit$1 {
10865
11044
  count++;
10866
11045
  }
10867
11046
  const data2 = records[count];
10868
- let index = data2.index;
10869
- const level = data2.level;
10870
- const row = rows[k];
10871
- if (!isNullOrUndefined(data2.parentItem)) {
10872
- index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);
10873
- }
10874
- const treecell = row.cells[treeColIndex];
10875
- if (!isNullOrUndefined(treecell)) {
10876
- for (let l = 0; l < treecell.classList.length; l++) {
10877
- const value = treecell.classList[l];
10878
- const remove$$1 = /e-gridrowindex/i;
10879
- const removed = /e-griddetailrowindex/i;
10880
- const result = value.match(remove$$1);
10881
- const results = value.match(removed);
10882
- if (result != null) {
10883
- removeClass([treecell], value);
10884
- }
10885
- if (results != null) {
10886
- removeClass([treecell], value);
10887
- }
10888
- }
10889
- if (!rows[k].classList.contains('e-detailrow')) {
10890
- addClass([treecell], 'e-gridrowindex' + index + 'level' + level);
10891
- }
10892
- else {
10893
- addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);
11047
+ if (!isNullOrUndefined(data2)) {
11048
+ let index = data2.index;
11049
+ const level = data2.level;
11050
+ const row = rows[k];
11051
+ if (!isNullOrUndefined(data2.parentItem)) {
11052
+ index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);
11053
+ }
11054
+ const treecell = row.cells[treeColIndex];
11055
+ if (!isNullOrUndefined(treecell)) {
11056
+ for (let l = 0; l < treecell.classList.length; l++) {
11057
+ const value = treecell.classList[l];
11058
+ const remove$$1 = /e-gridrowindex/i;
11059
+ const removed = /e-griddetailrowindex/i;
11060
+ const result = value.match(remove$$1);
11061
+ const results = value.match(removed);
11062
+ if (result != null) {
11063
+ removeClass([treecell], value);
11064
+ }
11065
+ if (results != null) {
11066
+ removeClass([treecell], value);
11067
+ }
11068
+ }
11069
+ if (!rows[k].classList.contains('e-detailrow')) {
11070
+ addClass([treecell], 'e-gridrowindex' + index + 'level' + level);
11071
+ }
11072
+ else {
11073
+ addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);
11074
+ }
10894
11075
  }
10895
11076
  }
10896
11077
  }
@@ -12183,100 +12364,6 @@ class TreeVirtual extends VirtualScroll {
12183
12364
  }
12184
12365
  }
12185
12366
 
12186
- /**
12187
- * TreeGrid Freeze module
12188
- *
12189
- * @hidden
12190
- */
12191
- class Freeze$1 {
12192
- /**
12193
- * Constructor for render module
12194
- *
12195
- * @param {TreeGrid} parent - Tree Grid instance
12196
- */
12197
- constructor(parent) {
12198
- Grid.Inject(Freeze);
12199
- this.parent = parent;
12200
- this.addEventListener();
12201
- }
12202
- addEventListener() {
12203
- this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
12204
- this.parent.on('dataBoundArg', this.dataBoundArg, this);
12205
- this.parent.grid.on('dblclick', this.dblClickHandler, this);
12206
- }
12207
- removeEventListener() {
12208
- if (this.parent.isDestroyed) {
12209
- return;
12210
- }
12211
- this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
12212
- this.parent.off('dataBoundArg', this.dataBoundArg);
12213
- this.parent.grid.off('dblclick', this.dblClickHandler);
12214
- }
12215
- rowExpandCollapse(args) {
12216
- const movableRows = this.parent.getMovableDataRows();
12217
- const frozenrows = this.parent.getRows();
12218
- let rows;
12219
- let frozenRightRows;
12220
- const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
12221
- this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
12222
- if (freeze) {
12223
- frozenRightRows = this.parent.getFrozenRightRows().filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
12224
- }
12225
- if (!args.detailrows.length) {
12226
- rows = movableRows.filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
12227
- }
12228
- else {
12229
- rows = args.detailrows;
12230
- }
12231
- for (let i = 0; i < rows.length; i++) {
12232
- const rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
12233
- rows[i].style.display = args.action;
12234
- if (freeze) {
12235
- frozenRightRows[i].style.display = args.action;
12236
- }
12237
- const queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
12238
- : '.e-treecolumn-container .e-treegridexpand';
12239
- if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {
12240
- const cRow = [];
12241
- for (let i = 0; i < movableRows.length; i++) {
12242
- if (movableRows[i].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {
12243
- cRow.push(movableRows[i]);
12244
- }
12245
- }
12246
- if (cRow.length) {
12247
- this.rowExpandCollapse({ detailrows: cRow, action: args.action });
12248
- }
12249
- }
12250
- }
12251
- }
12252
- dblClickHandler(e) {
12253
- if (parentsUntil(e.target, 'e-rowcell') &&
12254
- this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
12255
- this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
12256
- }
12257
- }
12258
- dataBoundArg() {
12259
- const checkboxColumn = this.parent.getColumns().filter((e) => {
12260
- return e.showCheckbox;
12261
- });
12262
- if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {
12263
- addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');
12264
- }
12265
- }
12266
- destroy() {
12267
- this.removeEventListener();
12268
- }
12269
- /**
12270
- * For internal use only - Get the module name.
12271
- *
12272
- * @private
12273
- * @returns {string} Returns Freeze module name
12274
- */
12275
- getModuleName() {
12276
- return 'freeze';
12277
- }
12278
- }
12279
-
12280
12367
  /**
12281
12368
  * TreeGrid ColumnChooser module
12282
12369
  *
@@ -12607,7 +12694,7 @@ class InfiniteScroll$1 {
12607
12694
  if (getValue('selectedIndex', this.parent.editModule) !== -1 && this.parent.editSettings.newRowPosition !== 'Top') {
12608
12695
  if (this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {
12609
12696
  position = 'after';
12610
- newRowIndex += findChildrenRecords(currentData[newRowIndex + 1]).length;
12697
+ newRowIndex += findChildrenRecords(currentData[newRowIndex]).length;
12611
12698
  if (this.parent.editSettings.newRowPosition === 'Child') {
12612
12699
  newRowIndex -= 1; //// for child position already child record is added in childRecords so subtracting 1
12613
12700
  }