@syncfusion/ej2-treegrid 33.2.8 → 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.
@@ -8587,10 +8587,25 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8587
8587
  this.grid.on('initial-end', this.afterGridRender, this);
8588
8588
  this.grid.on('partial-filter-update', this.partialFilterUpdate, this);
8589
8589
  this.grid.on('get-row-cells', this.getCellsByTableName, this);
8590
+ this.grid.on('save-complete', this.onSaveComplete, this);
8590
8591
  };
8591
8592
  TreeGrid.prototype.updateResultModel = function (returnResult) {
8592
8593
  this.dataResults = returnResult;
8593
8594
  };
8595
+ TreeGrid.prototype.onSaveComplete = function (args) {
8596
+ if (!this['isGantt'] && this.enableVirtualization && args.action === 'add'
8597
+ && (!isNullOrUndefined(args.index) && args.index !== -1) && args.data) {
8598
+ var primaryKeyField = this.getPrimaryKeyFieldNames()[0];
8599
+ var dataRecord = args.data;
8600
+ var addedRecordValue = Object.prototype.hasOwnProperty.call(dataRecord, primaryKeyField)
8601
+ ? dataRecord["" + primaryKeyField]
8602
+ : undefined;
8603
+ if (!isNullOrUndefined(addedRecordValue)) {
8604
+ var index = this.grid.getRowIndexByPrimaryKey(addedRecordValue);
8605
+ args.index = index !== -1 ? index : args.index;
8606
+ }
8607
+ }
8608
+ };
8594
8609
  /**
8595
8610
  * @hidden
8596
8611
  * @returns {void}
@@ -8604,6 +8619,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8604
8619
  this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
8605
8620
  this.grid.off('partial-filter-update', this.partialFilterUpdate);
8606
8621
  this.grid.off('get-row-cells', this.getCellsByTableName);
8622
+ this.grid.off('save-complete', this.onSaveComplete);
8607
8623
  };
8608
8624
  TreeGrid.prototype.getCellsByTableName = function (args) {
8609
8625
  if (!Array.isArray(args.elements)) {