@trudb/tru-common-lib 0.2.512 → 0.2.514

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.
@@ -2416,6 +2416,7 @@ class TruDesktopViewConfig {
2416
2416
  entityIndex = 0;
2417
2417
  entityRefs = '';
2418
2418
  parentTableRefName = '';
2419
+ parentEntity;
2419
2420
  isDirty = false;
2420
2421
  isEditing = false;
2421
2422
  isInvalid = false;
@@ -4804,6 +4805,7 @@ class TruDetailViewBase {
4804
4805
  customToolbarComponents = [];
4805
4806
  entities = [];
4806
4807
  entity;
4808
+ parentEntity;
4807
4809
  entityType;
4808
4810
  recordLocation = null;
4809
4811
  disableNavigationToPreviousEntity = false;
@@ -4843,7 +4845,9 @@ class TruDetailViewBase {
4843
4845
  onAddEntity = (newEntity, dataNotification = false) => {
4844
4846
  if (!newEntity)
4845
4847
  newEntity = this.dataContext.entityAccess().add(this.entityType);
4846
- if (!dataNotification && this.view.parentTableRefName)
4848
+ if (this.parentEntity && this.view.parentTableRefName)
4849
+ newEntity[this.view.parentTableRefName] = this.parentEntity[this.view.parentTableRefName];
4850
+ else
4847
4851
  newEntity[this.view.parentTableRefName] = this.entity[this.view.parentTableRefName];
4848
4852
  if (!dataNotification) {
4849
4853
  this.entities.unshift(newEntity);
@@ -4851,8 +4855,7 @@ class TruDetailViewBase {
4851
4855
  }
4852
4856
  else {
4853
4857
  this.entities.push(newEntity);
4854
- if (this.view.active)
4855
- this.setEntityDisplayValues(this.tableName);
4858
+ this.setEntityDisplayValues(this.tableName);
4856
4859
  }
4857
4860
  };
4858
4861
  onCloneEntity = () => {