@syncfusion/ej2-treegrid 33.2.3 → 33.2.10

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 : 33.2.3
3
+ * version : 33.2.10
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-treegrid",
3
- "version": "33.2.3",
3
+ "version": "33.2.10",
4
4
  "description": "Essential JS 2 TreeGrid Component",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -9,9 +9,9 @@
9
9
  "es2015": "./dist/es6/ej2-treegrid.es5.js",
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-base": "~33.2.3",
12
- "@syncfusion/ej2-data": "~33.2.3",
13
- "@syncfusion/ej2-grids": "~33.2.3",
14
- "@syncfusion/ej2-popups": "~33.2.3"
12
+ "@syncfusion/ej2-data": "~33.2.5",
13
+ "@syncfusion/ej2-grids": "~33.2.10",
14
+ "@syncfusion/ej2-popups": "~33.2.7"
15
15
  },
16
16
  "devDependencies": {},
17
17
  "keywords": [
@@ -182,13 +182,10 @@ var DataManipulation = /** @class */ (function () {
182
182
  // }
183
183
  DataManipulation.prototype.selfReferenceUpdate = function (selfData) {
184
184
  var result = [];
185
- while (this.hierarchyData.length > 0 && selfData.length > 0) {
186
- var index = selfData.indexOf(this.hierarchyData[0]);
187
- if (index === -1) {
188
- this.hierarchyData.shift();
189
- }
190
- else {
191
- result.push(this.hierarchyData.shift());
185
+ for (var i = 0; i < this.hierarchyData.length && selfData.length > 0; i++) {
186
+ var index = selfData.indexOf(this.hierarchyData[parseInt(i.toString(), 10)]);
187
+ if (index !== -1) {
188
+ result.push(this.hierarchyData[parseInt(i.toString(), 10)]);
192
189
  selfData.splice(index, 1);
193
190
  }
194
191
  }
@@ -2169,6 +2169,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
2169
2169
  */
2170
2170
  addListener(): void;
2171
2171
  private updateResultModel;
2172
+ private onSaveComplete;
2172
2173
  /**
2173
2174
  * @hidden
2174
2175
  * @returns {void}
@@ -4348,10 +4348,25 @@ var TreeGrid = /** @class */ (function (_super) {
4348
4348
  this.grid.on('initial-end', this.afterGridRender, this);
4349
4349
  this.grid.on('partial-filter-update', this.partialFilterUpdate, this);
4350
4350
  this.grid.on('get-row-cells', this.getCellsByTableName, this);
4351
+ this.grid.on('save-complete', this.onSaveComplete, this);
4351
4352
  };
4352
4353
  TreeGrid.prototype.updateResultModel = function (returnResult) {
4353
4354
  this.dataResults = returnResult;
4354
4355
  };
4356
+ TreeGrid.prototype.onSaveComplete = function (args) {
4357
+ if (!this['isGantt'] && this.enableVirtualization && args.action === 'add'
4358
+ && (!isNullOrUndefined(args.index) && args.index !== -1) && args.data) {
4359
+ var primaryKeyField = this.getPrimaryKeyFieldNames()[0];
4360
+ var dataRecord = args.data;
4361
+ var addedRecordValue = Object.prototype.hasOwnProperty.call(dataRecord, primaryKeyField)
4362
+ ? dataRecord["" + primaryKeyField]
4363
+ : undefined;
4364
+ if (!isNullOrUndefined(addedRecordValue)) {
4365
+ var index = this.grid.getRowIndexByPrimaryKey(addedRecordValue);
4366
+ args.index = index !== -1 ? index : args.index;
4367
+ }
4368
+ }
4369
+ };
4355
4370
  /**
4356
4371
  * @hidden
4357
4372
  * @returns {void}
@@ -4365,6 +4380,7 @@ var TreeGrid = /** @class */ (function (_super) {
4365
4380
  this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
4366
4381
  this.grid.off('partial-filter-update', this.partialFilterUpdate);
4367
4382
  this.grid.off('get-row-cells', this.getCellsByTableName);
4383
+ this.grid.off('save-complete', this.onSaveComplete);
4368
4384
  };
4369
4385
  TreeGrid.prototype.getCellsByTableName = function (args) {
4370
4386
  if (!Array.isArray(args.elements)) {
@@ -735,7 +735,8 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
735
735
  var index = scrolledRows + visibleRows - this.parent.pageSettings.pageSize;
736
736
  index = (index > 0) ? index : 0;
737
737
  if (!isNullOrUndefined(this["" + selectedRowIndex]) && this["" + selectedRowIndex] !== -1 && index !== this["" + selectedRowIndex] &&
738
- ((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop) && !this.parent.allowRowDragAndDrop) {
738
+ (this.parent.rowHeight && ((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop)) &&
739
+ !this.parent.allowRowDragAndDrop) {
739
740
  index = this["" + selectedRowIndex];
740
741
  }
741
742
  this.startIndex = index;