@syncfusion/ej2-treegrid 19.3.53 → 19.3.55

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.
@@ -2165,7 +2165,9 @@ class DataManipulation {
2165
2165
  const query = getObject('query', args);
2166
2166
  const srtQry = new Query();
2167
2167
  for (let srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {
2168
- const col = this.parent.grid.getColumnByField(this.parent.grid.sortSettings.columns[srt].field);
2168
+ const getColumnByField = 'getColumnByField';
2169
+ const col = this.parent.grid.renderModule.data[getColumnByField](this.parent.grid.
2170
+ sortSettings.columns[srt].field);
2169
2171
  const compFun = col.sortComparer && isOffline(this.parent) ?
2170
2172
  col.sortComparer.bind(col) :
2171
2173
  this.parent.grid.sortSettings.columns[srt].direction;
@@ -3569,6 +3571,15 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3569
3571
  this.trigger(rowSelecting, args);
3570
3572
  };
3571
3573
  this.grid.rowSelected = (args) => {
3574
+ if (this.enableVirtualization && args.isHeaderCheckboxClicked &&
3575
+ this.grid.currentViewData.length !== this.grid.selectionModule.selectedRowIndexes.length) {
3576
+ const updateRowSelection = 'updateRowSelection';
3577
+ for (let i = 0; i < this.getRows().length; i++) {
3578
+ if (this.getRows()[i].getElementsByClassName("e-frame e-icons e-uncheck").length) {
3579
+ this.grid.selectionModule[updateRowSelection](this.getRows()[i], this.getCurrentViewRecords()[i].index);
3580
+ }
3581
+ }
3582
+ }
3572
3583
  this.selectedRowIndex = this.grid.selectedRowIndex;
3573
3584
  this.notify(rowSelected, args);
3574
3585
  this.trigger(rowSelected, args);
@@ -10527,6 +10538,7 @@ class Edit$1 {
10527
10538
  }
10528
10539
  if (this.isAddedRowByMethod && args.index !== 0) {
10529
10540
  this.addRowRecord = this.parent.flatData[args.index];
10541
+ this.addRowIndex = args.index;
10530
10542
  }
10531
10543
  if (this.parent.editSettings.newRowPosition === 'Child' && isNullOrUndefined(this.addRowRecord)
10532
10544
  && !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
@@ -10555,6 +10567,11 @@ class Edit$1 {
10555
10567
  let position = null;
10556
10568
  value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
10557
10569
  const currentData = this.parent.grid.getCurrentViewRecords();
10570
+ if (this.parent.enableVirtualization && args.index !== 0) {
10571
+ this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
10572
+ this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'));
10573
+
10574
+ }
10558
10575
  let index = this.addRowIndex;
10559
10576
  value.uniqueID = getUid(this.parent.element.id + '_data_');
10560
10577
  setValue('uniqueIDCollection.' + value.uniqueID, value, this.parent);
@@ -11057,7 +11074,9 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11057
11074
  if (isNullOrUndefined(this.observer[containerRect])) {
11058
11075
  this.observer[containerRect] = this.observers[containerRect];
11059
11076
  }
11060
- super[selectVirtualRow](args);
11077
+ if (args.selectedIndex !== 0 || isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
11078
+ super[selectVirtualRow](args);
11079
+ }
11061
11080
  }
11062
11081
  refreshCell(rowObj) {
11063
11082
  rowObj.cells = this.generateCells();
@@ -11523,6 +11542,11 @@ class VirtualScroll$1 {
11523
11542
  }
11524
11543
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
11525
11544
  //this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
11545
+ if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||
11546
+ (pageingDetails.actionArgs.requestType === 'refresh' && startIndex !== this.prevstartIndex)) &&
11547
+ (startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length)) {
11548
+ startIndex = 0;
11549
+ }
11526
11550
  if (!isNullOrUndefined(this.expandCollapseRec)) {
11527
11551
  const resourceCount = this.parent.getRows();
11528
11552
  let sIndex = visualData.indexOf(this.expandCollapseRec);