@trudb/tru-common-lib 0.2.359 → 0.2.361

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.
@@ -7743,7 +7743,7 @@ class TruDataGrid {
7743
7743
  setNoRowsTemplate = () => {
7744
7744
  //this.noRowsTemplate = `<span style="font-size:14px;font-weight:bold;">No data found.</span>`;
7745
7745
  };
7746
- applyRelationships = (newEntity) => {
7746
+ applyRelationshipsAndUpdateGrid = (newEntity) => {
7747
7747
  if (this.entity) {
7748
7748
  newEntity[this.config.parentTableRelationshipRefName] = this.entity[this.config.parentTableRefName];
7749
7749
  }
@@ -7767,9 +7767,17 @@ class TruDataGrid {
7767
7767
  this.selectedUnassociatedChoice = undefined;
7768
7768
  // add row to grid
7769
7769
  this.unsavedEntities.push(enhancedEntity);
7770
+ this.rowData.push(newEntity);
7771
+ this.api.applyTransaction({ add: [newEntity], addIndex: 0 });
7772
+ this.api.refreshCells({ force: true });
7770
7773
  }
7771
7774
  });
7772
7775
  }
7776
+ else {
7777
+ this.rowData.push(newEntity);
7778
+ this.api.applyTransaction({ add: [newEntity], addIndex: 0 });
7779
+ this.api.refreshCells({ force: true });
7780
+ }
7773
7781
  };
7774
7782
  subscribeTo = () => {
7775
7783
  this.subs.push(this.appEnvironment.onSaveComplete$.pipe(skip(1)).subscribe(event => {
@@ -7986,9 +7994,7 @@ class TruDataGrid {
7986
7994
  });
7987
7995
  if (newEntity.Ref < 0 && !entityAlreadyInGrid) {
7988
7996
  let enhancedEntity = this.enhanceRowDataForEntity(newEntity);
7989
- this.applyRelationships(newEntity);
7990
- this.rowData.push(enhancedEntity);
7991
- this.api.applyTransaction({ add: [enhancedEntity], addIndex: 0 });
7997
+ this.applyRelationshipsAndUpdateGrid(enhancedEntity);
7992
7998
  }
7993
7999
  else {
7994
8000
  let results;