@syncfusion/ej2-treegrid 20.2.38 → 20.2.43

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.
@@ -438,6 +438,8 @@ const rowdraging = 'row-draging';
438
438
  const rowDropped = 'row-dropped';
439
439
  /** @hidden */
440
440
  const autoCol = 'auto-col';
441
+ /** @hidden */
442
+ const rowDeselecting = 'rowDeselecting';
441
443
 
442
444
  /**
443
445
  * The `Clipboard` module is used to handle clipboard copy action.
@@ -722,7 +724,7 @@ function findChildrenRecords(records) {
722
724
  return [];
723
725
  }
724
726
  if (!isNullOrUndefined(records.childRecords)) {
725
- const childRecords = records.childRecords;
727
+ const childRecords = records.childRecords.filter(items => !items.isSummaryRow);
726
728
  const keys = Object.keys(childRecords);
727
729
  for (let i = 0, len = keys.length; i < len; i++) {
728
730
  datas.push(childRecords[i]);
@@ -1236,7 +1238,7 @@ class Selection {
1236
1238
  childData = (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) ?
1237
1239
  this.parent.getCurrentViewRecords() : this.parent.flatData;
1238
1240
  childData.forEach((record) => {
1239
- if (this.parent.enableVirtualization) {
1241
+ if (this.parent.enableVirtualization && record.childRecords.length > 0) {
1240
1242
  if (record.hasChildRecords) {
1241
1243
  this.updateParentSelection(record);
1242
1244
  }
@@ -1617,7 +1619,7 @@ class Render {
1617
1619
  const templateFn = 'templateFn';
1618
1620
  const colindex = args.column.index;
1619
1621
  if (isNullOrUndefined(treeColumn.field)) {
1620
- args.cell.setAttribute('aria-colindex', colindex + '');
1622
+ args.cell.setAttribute('data-colindex', colindex + '');
1621
1623
  }
1622
1624
  if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {
1623
1625
  args.column.template = treeColumn.template;
@@ -3678,15 +3680,22 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3678
3680
  triggerEvents(args) {
3679
3681
  this.trigger(getObject('name', args), args);
3680
3682
  }
3683
+ IsExpandCollapseClicked(args) {
3684
+ if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3685
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
3686
+ args.cancel = true;
3687
+ return;
3688
+ }
3689
+ }
3681
3690
  bindGridEvents() {
3682
3691
  this.grid.rowSelecting = (args) => {
3683
- if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3684
- || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
3685
- args.cancel = true;
3686
- return;
3687
- }
3692
+ this.IsExpandCollapseClicked(args);
3688
3693
  this.trigger(rowSelecting, args);
3689
3694
  };
3695
+ this.grid.rowDeselecting = (args) => {
3696
+ this.IsExpandCollapseClicked(args);
3697
+ this.trigger(rowDeselecting, args);
3698
+ };
3690
3699
  this.grid.rowSelected = (args) => {
3691
3700
  if (this.enableVirtualization && args.isHeaderCheckboxClicked &&
3692
3701
  this.grid.currentViewData.length !== this.grid.selectionModule.selectedRowIndexes.length) {
@@ -5458,7 +5467,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5458
5467
  }
5459
5468
  else if (isNullOrUndefined(record)) {
5460
5469
  if (this.detailTemplate) {
5461
- record = this.grid.getCurrentViewRecords()[row.getAttribute('aria-rowindex')];
5470
+ record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
5462
5471
  }
5463
5472
  else {
5464
5473
  record = this.grid.getCurrentViewRecords()[row.rowIndex];
@@ -5729,7 +5738,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5729
5738
  row = gridRows[rowIndex];
5730
5739
  }
5731
5740
  else {
5732
- rowIndex = +row.getAttribute('aria-rowindex');
5741
+ rowIndex = +row.getAttribute('data-rowindex');
5733
5742
  }
5734
5743
  if (!isNullOrUndefined(row)) {
5735
5744
  row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
@@ -7115,7 +7124,7 @@ class RowDD$1 {
7115
7124
  dropIndex = this.selectedRow.rowIndex - 1;
7116
7125
  }
7117
7126
  if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
7118
- dropIndex = parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10) - 1;
7127
+ dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;
7119
7128
  }
7120
7129
  tObj[action] = 'indenting';
7121
7130
  tObj[droppedIndex] = dropIndex;
@@ -7134,7 +7143,7 @@ class RowDD$1 {
7134
7143
  }
7135
7144
  }
7136
7145
  if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
7137
- dropIndex = parseInt(this.parent.getRows()[dropIndex].getAttribute('aria-rowindex'), 10);
7146
+ dropIndex = parseInt(this.parent.getRows()[dropIndex].getAttribute('data-rowindex'), 10);
7138
7147
  }
7139
7148
  tObj[action] = 'outdenting';
7140
7149
  tObj[droppedIndex] = dropIndex;
@@ -7153,7 +7162,7 @@ class RowDD$1 {
7153
7162
  if (!actionArgs.cancel) {
7154
7163
  if (actionArgs.action === 'indenting') {
7155
7164
  if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop) {
7156
- this.reorderRows([parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10)], dropIndex, 'child');
7165
+ this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'child');
7157
7166
  }
7158
7167
  else {
7159
7168
  this.reorderRows([this.selectedRow.rowIndex], dropIndex, 'child');
@@ -7161,7 +7170,7 @@ class RowDD$1 {
7161
7170
  }
7162
7171
  else if (actionArgs.action === 'outdenting') {
7163
7172
  if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop) {
7164
- this.reorderRows([parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10)], dropIndex, 'below');
7173
+ this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'below');
7165
7174
  }
7166
7175
  else {
7167
7176
  this.reorderRows([this.selectedRow.rowIndex], dropIndex, 'below');
@@ -7787,7 +7796,7 @@ class RowDD$1 {
7787
7796
  }
7788
7797
  }
7789
7798
  getTargetIdx(targetRow) {
7790
- return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) : 0;
7799
+ return targetRow ? parseInt(targetRow.getAttribute('data-rowindex'), 10) : 0;
7791
7800
  }
7792
7801
  getParentData(record, data) {
7793
7802
  const parentItem = record.parentItem;
@@ -9813,6 +9822,7 @@ class ContextMenu$1 {
9813
9822
  if (args.item.id === 'Above' || args.item.id === 'Below' || args.item.id === 'Child') {
9814
9823
  this.parent.notify('savePreviousRowPosition', args);
9815
9824
  this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);
9825
+ this.parent.editModule['isAddedRowByContextMenu'] = true;
9816
9826
  this.parent.addRecord();
9817
9827
  }
9818
9828
  if (args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' || args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Outdent') {
@@ -10083,10 +10093,11 @@ class BatchEdit {
10083
10093
  this.parent.editModule[isTabLastRow] = false;
10084
10094
  return;
10085
10095
  }
10086
- if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && this.parent.grid.selectedRowIndex === -1) {
10096
+ if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) &&
10097
+ !this.parent.editModule['isAddedRowByContextMenu'] && (this.parent.grid.selectedRowIndex === -1 || this.parent.editModule['batchEditModule'].isAdd)) {
10087
10098
  this.selectedIndex = this.parent.editModule['selectedIndex'];
10088
10099
  this.addRowIndex = this.parent.editModule['addRowIndex'];
10089
- this.addRowRecord = this.parent.getCurrentViewRecords()[this.selectedIndex];
10100
+ this.addRowRecord = this.batchRecords.length ? this.batchRecords[this.selectedIndex] : this.parent.getCurrentViewRecords()[this.selectedIndex];
10090
10101
  }
10091
10102
  else {
10092
10103
  this.selectedIndex = this.parent.grid.selectedRowIndex;
@@ -10133,6 +10144,11 @@ class BatchEdit {
10133
10144
  // }
10134
10145
  }
10135
10146
  focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
10147
+ if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
10148
+ const newlyAddedRecords = this.parent.getBatchChanges()['addedRecords'];
10149
+ const index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('data-rowindex'), 10);
10150
+ this.batchRecords.splice(index, 0, newlyAddedRecords[newlyAddedRecords.length - 1]);
10151
+ }
10136
10152
  }
10137
10153
  }
10138
10154
  beforeBatchDelete(args) {
@@ -10158,7 +10174,7 @@ class BatchEdit {
10158
10174
  childs = findChildrenRecords(data);
10159
10175
  uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
10160
10176
  }
10161
- const parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);
10177
+ const parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('data-rowindex'), 10);
10162
10178
  if (childs.length) {
10163
10179
  const totalCount = parentRowIndex + childs.length;
10164
10180
  const firstChildIndex = parentRowIndex + 1;
@@ -10195,7 +10211,7 @@ class BatchEdit {
10195
10211
  updateRowIndex() {
10196
10212
  const rows = this.parent.grid.getDataRows();
10197
10213
  for (let i = 0; i < rows.length; i++) {
10198
- rows[i].setAttribute('aria-rowindex', i.toString());
10214
+ rows[i].setAttribute('data-rowindex', i.toString());
10199
10215
  }
10200
10216
  const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
10201
10217
  this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
@@ -10203,9 +10219,9 @@ class BatchEdit {
10203
10219
  const mRows = this.parent.grid.getMovableDataRows();
10204
10220
  const freezeRightRows = this.parent.grid.getFrozenRightDataRows();
10205
10221
  for (let i = 0; i < mRows.length; i++) {
10206
- mRows[i].setAttribute('aria-rowindex', i.toString());
10222
+ mRows[i].setAttribute('data-rowindex', i.toString());
10207
10223
  if (freeze) {
10208
- freezeRightRows[i].setAttribute('aria-rowindex', i.toString());
10224
+ freezeRightRows[i].setAttribute('data-rowindex', i.toString());
10209
10225
  }
10210
10226
  }
10211
10227
  }
@@ -10265,7 +10281,9 @@ class BatchEdit {
10265
10281
  if (!isNullOrUndefined(this.batchAddedRecords)) {
10266
10282
  for (let i = 0; i < this.batchAddedRecords.length; i++) {
10267
10283
  index = data.map((e) => { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
10268
- data.splice(index, 1);
10284
+ if (index !== -1) {
10285
+ data.splice(index, 1);
10286
+ }
10269
10287
  if (this.parent.editSettings.newRowPosition === 'Child') {
10270
10288
  index = currentViewRecords.map((e) => { return e[primaryKey]; })
10271
10289
  .indexOf(this.batchAddedRecords[i][parentItem] ? this.batchAddedRecords[i][parentItem][primaryKey]
@@ -10331,9 +10349,12 @@ class BatchEdit {
10331
10349
  }
10332
10350
  if (this.parent.editSettings.newRowPosition !== 'Bottom' && !Object.hasOwnProperty.call(args, 'updatedRecords')) {
10333
10351
  data.splice(data.length - addRecords.length, addRecords.length);
10334
- if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {
10335
- const index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[0].getAttribute('aria-rowindex'), 10);
10336
- data.splice(index, 0, addRecords[0]);
10352
+ if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
10353
+ addRecords.reverse();
10354
+ for (let i = 0; i < addRecords.length; i++) {
10355
+ const index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[i].getAttribute('data-rowindex'), 10);
10356
+ data.splice(index, 0, addRecords[i]);
10357
+ }
10337
10358
  }
10338
10359
  if (!this.parent.allowPaging && data.length !== currentViewRecords.length) {
10339
10360
  if (currentViewRecords.length > addRecords.length) {
@@ -10353,6 +10374,9 @@ class BatchEdit {
10353
10374
  if (this.batchAddRowRecord.length === 0) {
10354
10375
  this.batchAddRowRecord.push(this.parent.flatData[args.index]);
10355
10376
  }
10377
+ if (this.parent.editModule['isAddedRowByContextMenu']) {
10378
+ addRecords.reverse();
10379
+ }
10356
10380
  for (i = 0; i < addRecords.length; i++) {
10357
10381
  const taskData = extend({}, addRecords[i]);
10358
10382
  delete taskData.parentItem;
@@ -10365,6 +10389,11 @@ class BatchEdit {
10365
10389
  if (!isNullOrUndefined(taskData.primaryParent)) {
10366
10390
  delete taskData.primaryParent;
10367
10391
  }
10392
+ if (addRecords.length > 1 && this.parent.editModule['isAddedRowByContextMenu']) {
10393
+ const rowPosition = this.parent.editSettings.newRowPosition;
10394
+ this.parent.editSettings.newRowPosition = this.parent.editModule['previousNewRowPosition'];
10395
+ this.parent.editModule['previousNewRowPosition'] = rowPosition;
10396
+ }
10368
10397
  addRecords[i].taskData = taskData;
10369
10398
  addRowRecord = this.batchAddRowRecord[i];
10370
10399
  if (isNullOrUndefined(addRowRecord)) {
@@ -10413,6 +10442,9 @@ class BatchEdit {
10413
10442
  }
10414
10443
  }
10415
10444
  this.batchAddRowRecord = this.batchAddedRecords = this.batchRecords = this.batchDeletedRecords = this.currentViewRecords = [];
10445
+ if (this.parent.editModule['isAddedRowByContextMenu']) {
10446
+ this.parent.editModule['isAddedRowByContextMenu'] = false;
10447
+ }
10416
10448
  }
10417
10449
  getActualRowObjectIndex(index) {
10418
10450
  const rows = this.parent.grid.getDataRows();
@@ -10481,6 +10513,7 @@ class Edit$1 {
10481
10513
  this.deletedRecords = 'deletedRecords';
10482
10514
  this.prevAriaRowIndex = '-1';
10483
10515
  this.isAddedRowByMethod = false;
10516
+ this.isAddedRowByContextMenu = false;
10484
10517
  Grid.Inject(Edit);
10485
10518
  this.parent = parent;
10486
10519
  this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
@@ -10531,7 +10564,7 @@ class Edit$1 {
10531
10564
  getRowPosition(addArgs) {
10532
10565
  addArgs.newRowPosition = this.parent.editSettings.newRowPosition;
10533
10566
  addArgs.addRowIndex = this.addRowIndex;
10534
- addArgs.ariaRowIndex = +this.prevAriaRowIndex;
10567
+ addArgs.dataRowIndex = +this.prevAriaRowIndex;
10535
10568
  }
10536
10569
  beforeStartEdit(args) {
10537
10570
  this.parent.trigger(actionBegin, args);
@@ -10686,7 +10719,7 @@ class Edit$1 {
10686
10719
  if (!(this.parent.grid.editSettings.allowEditing) || this.parent.grid.isEdit) {
10687
10720
  return;
10688
10721
  }
10689
- const column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('aria-colindex'));
10722
+ const column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('data-colindex'));
10690
10723
  if (this.parent.editSettings.mode === 'Cell' && !this.isOnBatch && column && !column.isPrimaryKey &&
10691
10724
  this.parent.editSettings.allowEditing && column.allowEditing && !(target.classList.contains('e-treegridexpand') ||
10692
10725
  target.classList.contains('e-treegridcollapse')) && this.parent.editSettings.allowEditOnDblClick) {
@@ -10694,8 +10727,8 @@ class Edit$1 {
10694
10727
  this.parent.grid.setProperties({ selectedRowIndex: args.rowIndex }, true);
10695
10728
  if (this.parent.enableVirtualization) {
10696
10729
  const tr = parentsUntil(args.target, 'e-row');
10697
- this.prevAriaRowIndex = tr.getAttribute('aria-rowindex');
10698
- tr.setAttribute('aria-rowindex', tr.rowIndex + '');
10730
+ this.prevAriaRowIndex = tr.getAttribute('data-rowindex');
10731
+ tr.setAttribute('data-rowindex', tr.rowIndex + '');
10699
10732
  }
10700
10733
  this.updateGridEditMode('Batch');
10701
10734
  }
@@ -10734,7 +10767,7 @@ class Edit$1 {
10734
10767
  const prom = args[promise];
10735
10768
  delete args[promise];
10736
10769
  if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {
10737
- args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);
10770
+ args.row.setAttribute('data-rowindex', this.prevAriaRowIndex);
10738
10771
  this.prevAriaRowIndex = undefined;
10739
10772
  }
10740
10773
  if (this.keyPress !== 'enter') {
@@ -11069,8 +11102,8 @@ class Edit$1 {
11069
11102
  }
11070
11103
  }
11071
11104
  const rows = this.parent.grid.getDataRows();
11072
- const firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;
11073
- const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
11105
+ const firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;
11106
+ const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
11074
11107
  const withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11075
11108
  const isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
11076
11109
  if (this.parent.editSettings.mode !== 'Dialog') {
@@ -11140,20 +11173,27 @@ class Edit$1 {
11140
11173
  focussedElement.focus();
11141
11174
  }
11142
11175
  }
11143
- if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1) {
11176
+ if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1 && this['isAddedRowByMethod'] && !this.isAddedRowByContextMenu) {
11144
11177
  index = this.batchEditModule.getAddRowIndex();
11145
11178
  this.selectedIndex = this.batchEditModule.getSelectedIndex();
11146
- if (this.parent.editModule['isAddedRowByMethod']) {
11147
- const args = {
11148
- action: 'add',
11149
- data: this.parent.getBatchChanges()['addedRecords'][0],
11150
- index: index,
11151
- seletedRow: 0
11152
- };
11153
- this.parent.editModule.beginAddEdit(args);
11154
- this.parent.editModule.batchEditModule['batchAddRowRecord'].push(this.parent.editModule.batchEditModule['addRowRecord']);
11155
- this.parent.editModule.batchEditModule['batchAddedRecords'].push(args['data']);
11179
+ const batchAddedRecords = this.parent.getBatchChanges()['addedRecords'];
11180
+ let newlyAddedRecord;
11181
+ if (batchAddedRecords.length) {
11182
+ for (let i = 0; i < batchAddedRecords.length; i++) {
11183
+ if (isNullOrUndefined(batchAddedRecords[i].uniqueID)) {
11184
+ newlyAddedRecord = batchAddedRecords[i];
11185
+ }
11186
+ }
11156
11187
  }
11188
+ const args = {
11189
+ action: 'add',
11190
+ data: newlyAddedRecord,
11191
+ index: index,
11192
+ seletedRow: 0
11193
+ };
11194
+ this.beginAddEdit(args);
11195
+ this.batchEditModule['batchAddRowRecord'].push(this.batchEditModule['addRowRecord']);
11196
+ this.batchEditModule['batchAddedRecords'].push(args['data']);
11157
11197
  }
11158
11198
  }
11159
11199
  // private beforeDataBound(args: BeforeDataBoundArgs): void {
@@ -11216,7 +11256,7 @@ class Edit$1 {
11216
11256
  this.selectedIndex = this.parent.grid.selectedRowIndex;
11217
11257
  }
11218
11258
  if (this.parent.enableVirtualization) {
11219
- let selector = '.e-row[aria-rowindex="' + this.selectedIndex + '"]';
11259
+ let selector = '.e-row[data-rowindex="' + this.selectedIndex + '"]';
11220
11260
  let row;
11221
11261
  if (this.selectedIndex > -1 && this.parent.editSettings.newRowPosition !== 'Top' &&
11222
11262
  this.parent.editSettings.newRowPosition !== 'Bottom') {
@@ -11226,7 +11266,7 @@ class Edit$1 {
11226
11266
  }
11227
11267
  else {
11228
11268
  if (this.prevAriaRowIndex && this.prevAriaRowIndex !== '-1') {
11229
- selector = '.e-row[aria-rowindex="' + this.prevAriaRowIndex + '"]';
11269
+ selector = '.e-row[data-rowindex="' + this.prevAriaRowIndex + '"]';
11230
11270
  row = this.parent.getContent().querySelector(selector);
11231
11271
  this.addRowIndex = row ? row.rowIndex : 0;
11232
11272
  }
@@ -11285,10 +11325,16 @@ class Edit$1 {
11285
11325
  const key = this.parent.grid.getPrimaryKeyFieldNames()[0];
11286
11326
  let position = null;
11287
11327
  value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
11288
- const currentData = this.parent.grid.getCurrentViewRecords();
11328
+ let currentData;
11329
+ if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
11330
+ currentData = this.batchEditModule['batchRecords'];
11331
+ }
11332
+ else {
11333
+ currentData = this.parent.grid.getCurrentViewRecords();
11334
+ }
11289
11335
  if (this.parent.enableVirtualization && args.index !== 0) {
11290
11336
  this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
11291
- this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
11337
+ this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('data-rowindex'), 10);
11292
11338
  }
11293
11339
  let index = this.addRowIndex;
11294
11340
  value.uniqueID = getUid(this.parent.element.id + '_data_');
@@ -11301,7 +11347,7 @@ class Edit$1 {
11301
11347
  const isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
11302
11348
  const rows = this.parent.getRows();
11303
11349
  const firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
11304
- const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
11350
+ const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
11305
11351
  const withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11306
11352
  if (currentData.length) {
11307
11353
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
@@ -11648,7 +11694,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11648
11694
  return new TreeVirtualRowModelGenerator(this.parent);
11649
11695
  }
11650
11696
  getRowByIndex(index) {
11651
- return this.parent.getDataRows().filter((e) => parseInt(e.getAttribute('aria-rowindex'), 10) === index)[0];
11697
+ return this.parent.getDataRows().filter((e) => parseInt(e.getAttribute('data-rowindex'), 10) === index)[0];
11652
11698
  }
11653
11699
  addEventListener() {
11654
11700
  this.parent.on(virtualActionArgs, this.virtualOtherAction, this);
@@ -11826,7 +11872,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11826
11872
  return new Cell(opt);
11827
11873
  }
11828
11874
  beginEdit(e) {
11829
- const selector = '.e-row[aria-rowindex="' + e.index + '"]';
11875
+ const selector = '.e-row[data-rowindex="' + e.index + '"]';
11830
11876
  const index = this.parent.getContent().querySelector(selector).rowIndex;
11831
11877
  const rowData = this.parent.getCurrentViewRecords()[index];
11832
11878
  e.data = rowData;
@@ -11834,14 +11880,14 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11834
11880
  beginAdd(args) {
11835
11881
  const addAction = 'addActionBegin';
11836
11882
  const isAdd = 'isAdd';
11837
- const addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };
11883
+ const addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
11838
11884
  this.parent.notify('get-row-position', addArgs);
11839
11885
  this.rowPosition = addArgs.newRowPosition;
11840
11886
  this.addRowIndex = addArgs.addRowIndex;
11841
- this.ariaRowIndex = addArgs.ariaRowIndex;
11887
+ this.dataRowIndex = addArgs.dataRowIndex;
11842
11888
  const rows = this.parent.getRows();
11843
- const firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;
11844
- const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
11889
+ const firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;
11890
+ const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
11845
11891
  const withInRange = this.parent.selectedRowIndex >= firstAriaIndex && this.parent.selectedRowIndex <= lastAriaIndex;
11846
11892
  if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {
11847
11893
  this[isAdd] = true;
@@ -11892,11 +11938,11 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11892
11938
  }
11893
11939
  onActionComplete(args) {
11894
11940
  if (args.requestType === 'add') {
11895
- const addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };
11941
+ const addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
11896
11942
  this.parent.notify('get-row-position', addArgs);
11897
11943
  this.rowPosition = addArgs.newRowPosition;
11898
11944
  this.addRowIndex = addArgs.addRowIndex;
11899
- this.ariaRowIndex = addArgs.ariaRowIndex;
11945
+ this.dataRowIndex = addArgs.dataRowIndex;
11900
11946
  }
11901
11947
  const actionComplete$$1 = 'actionComplete';
11902
11948
  super[actionComplete$$1](args);
@@ -11958,7 +12004,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11958
12004
  !isNullOrUndefined(this.parent.getContent().querySelectorAll('.e-content tr')[rowPt])) {
11959
12005
  const attr = this.parent.getContent().querySelectorAll('.e-content tr')[rowPt]
11960
12006
  .querySelector('td').getAttribute('index');
11961
- firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('aria-rowindex');
12007
+ firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('data-rowindex');
11962
12008
  }
11963
12009
  if (firsttdinx === 0) {
11964
12010
  if (this.parent.allowRowDragAndDrop) {
@@ -12057,7 +12103,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12057
12103
  const isAdd = 'isAdd';
12058
12104
  if (this[isAdd] && !this.parent.getContent().querySelector('.e-content').querySelector('.e-addedrow')) {
12059
12105
  if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {
12060
- if (this.ariaRowIndex >= this.startIndex) {
12106
+ if (this.dataRowIndex >= this.startIndex) {
12061
12107
  this.restoreNewRow();
12062
12108
  }
12063
12109
  else if (this.addRowIndex && this.addRowIndex > -1) {
@@ -12630,6 +12676,9 @@ class InfiniteScroll$1 {
12630
12676
  });
12631
12677
  const actionArgs = getValue('actionArgs', pageingDetails.actionArgs);
12632
12678
  const actions = getValue('actions', this.parent.grid.infiniteScrollModule);
12679
+ if (this.parent.grid.infiniteScrollModule['isInitialRender'] && !this.parent.initialRender) {
12680
+ this.parent.grid.pageSettings.currentPage = 1;
12681
+ }
12633
12682
  const initial = actions.some((value) => { return value === actionArgs.requestType; });
12634
12683
  const initialRender = initial ? true : this.parent.initialRender ? true : false;
12635
12684
  this.visualData = visualData;
@@ -12644,8 +12693,8 @@ class InfiniteScroll$1 {
12644
12693
  this.parent.infiniteScrollSettings.initialBlocks = this.parent.infiniteScrollSettings.maxBlocks;
12645
12694
  }
12646
12695
  let size = initialRender ?
12647
- this.parent.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :
12648
- this.parent.pageSettings.pageSize;
12696
+ this.parent.grid.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :
12697
+ this.parent.grid.pageSettings.pageSize;
12649
12698
  let current = this.parent.grid.pageSettings.currentPage;
12650
12699
  if (!isNullOrUndefined(actionArgs)) {
12651
12700
  const lastIndex = getValue('lastIndex', this.parent.grid.infiniteScrollModule);
@@ -12663,7 +12712,7 @@ class InfiniteScroll$1 {
12663
12712
  else {
12664
12713
  if ((pageingDetails.actionArgs['action'] === 'expand' || pageingDetails.actionArgs['action'] === 'collapse') && this.parent.grid.pageSettings.currentPage !== 1) {
12665
12714
  current = 1;
12666
- size = this.parent.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;
12715
+ size = this.parent.grid.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;
12667
12716
  }
12668
12717
  query = query.page(current, size);
12669
12718
  }
@@ -12830,5 +12879,5 @@ class InfiniteScroll$1 {
12830
12879
  * Export TreeGrid component
12831
12880
  */
12832
12881
 
12833
- export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
12882
+ export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, rowDeselecting, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
12834
12883
  //# sourceMappingURL=ej2-treegrid.es2015.js.map