@trudb/tru-common-lib 0.2.518 → 0.2.520

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.
@@ -4838,9 +4838,11 @@ class TruDetailViewBase {
4838
4838
  };
4839
4839
  renderCustomToolbarComponents = () => {
4840
4840
  this.customToolbarComponents.forEach((componentName) => {
4841
- let toolbarContainerRef = this.customToolbarContainer.createComponent(this.componentLookup.get(componentName));
4842
- toolbarContainerRef.instance.tableName = this.tableName;
4843
- toolbarContainerRef.instance.getEntities = () => { return [this.entity]; };
4841
+ if (componentName) {
4842
+ let toolbarContainerRef = this.customToolbarContainer.createComponent(this.componentLookup.get(componentName));
4843
+ toolbarContainerRef.instance.tableName = this.tableName;
4844
+ toolbarContainerRef.instance.getEntities = () => { return [this.entity]; };
4845
+ }
4844
4846
  });
4845
4847
  };
4846
4848
  onAddEntity = (newEntity, dataNotification = false) => {
@@ -4858,7 +4860,7 @@ class TruDetailViewBase {
4858
4860
  }
4859
4861
  else {
4860
4862
  this.entities.push(newEntity);
4861
- this.setEntityDisplayValues(this.tableName);
4863
+ this.setEntityDisplayValues(this.tableName, newEntity);
4862
4864
  }
4863
4865
  };
4864
4866
  onCloneEntity = () => {
@@ -4963,7 +4965,7 @@ class TruDetailViewBase {
4963
4965
  this.disableNavigationToNextEntity = index === this.entities.length - 1;
4964
4966
  this.entity = this.entities[this.navigationIndex];
4965
4967
  }
4966
- setEntityDisplayValues(tableName) {
4968
+ setEntityDisplayValues(tableName, newEntity = null) {
4967
4969
  let title = '';
4968
4970
  let recordIndex = '?';
4969
4971
  let entity = this.entities[this.navigationIndex];
@@ -4973,7 +4975,7 @@ class TruDetailViewBase {
4973
4975
  title += 'New Record';
4974
4976
  }
4975
4977
  else {
4976
- title += this.parentEntity ? this.parentEntity.HID : this.entity.HID;
4978
+ title += newEntity ? newEntity.HID : this.entity.HID;
4977
4979
  }
4978
4980
  recordIndex = (this.navigationIndex + 1).toString();
4979
4981
  }