@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.
@@ -8218,10 +8218,25 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
8218
8218
  this.grid.on('initial-end', this.afterGridRender, this);
8219
8219
  this.grid.on('partial-filter-update', this.partialFilterUpdate, this);
8220
8220
  this.grid.on('get-row-cells', this.getCellsByTableName, this);
8221
+ this.grid.on('save-complete', this.onSaveComplete, this);
8221
8222
  }
8222
8223
  updateResultModel(returnResult) {
8223
8224
  this.dataResults = returnResult;
8224
8225
  }
8226
+ onSaveComplete(args) {
8227
+ if (!this['isGantt'] && this.enableVirtualization && args.action === 'add'
8228
+ && (!isNullOrUndefined(args.index) && args.index !== -1) && args.data) {
8229
+ const primaryKeyField = this.getPrimaryKeyFieldNames()[0];
8230
+ const dataRecord = args.data;
8231
+ const addedRecordValue = Object.prototype.hasOwnProperty.call(dataRecord, primaryKeyField)
8232
+ ? dataRecord[`${primaryKeyField}`]
8233
+ : undefined;
8234
+ if (!isNullOrUndefined(addedRecordValue)) {
8235
+ const index = this.grid.getRowIndexByPrimaryKey(addedRecordValue);
8236
+ args.index = index !== -1 ? index : args.index;
8237
+ }
8238
+ }
8239
+ }
8225
8240
  /**
8226
8241
  * @hidden
8227
8242
  * @returns {void}
@@ -8235,6 +8250,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
8235
8250
  this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
8236
8251
  this.grid.off('partial-filter-update', this.partialFilterUpdate);
8237
8252
  this.grid.off('get-row-cells', this.getCellsByTableName);
8253
+ this.grid.off('save-complete', this.onSaveComplete);
8238
8254
  }
8239
8255
  getCellsByTableName(args) {
8240
8256
  if (!Array.isArray(args.elements)) {