@trudb/tru-common-lib 0.2.321 → 0.2.323
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.
|
@@ -7822,6 +7822,15 @@ class TruDataGrid {
|
|
|
7822
7822
|
}
|
|
7823
7823
|
});
|
|
7824
7824
|
}
|
|
7825
|
+
if (change.changeOperation === 'U') {
|
|
7826
|
+
this.api.forEachNode((rowNode) => {
|
|
7827
|
+
if (rowNode.data.$entity.Ref === change.tableRef) {
|
|
7828
|
+
let results = this.dataContext.entityAccess().searchByRefArrayCacheOnly(this.config.resultConfig.entityType, this.latestSetupQuery, [rowNode.data.$entity.Ref]);
|
|
7829
|
+
if (!results)
|
|
7830
|
+
rowNodesToRemove.push(rowNode.data);
|
|
7831
|
+
}
|
|
7832
|
+
});
|
|
7833
|
+
}
|
|
7825
7834
|
});
|
|
7826
7835
|
if (rowNodesToRemove.length) {
|
|
7827
7836
|
this.api.applyTransaction({ remove: rowNodesToRemove });
|
|
@@ -7834,21 +7843,21 @@ class TruDataGrid {
|
|
|
7834
7843
|
this.subs.push(this.dataContext.onEntityAdded().subscribe((changeArgs) => {
|
|
7835
7844
|
if (!changeArgs.entity)
|
|
7836
7845
|
return;
|
|
7837
|
-
let
|
|
7846
|
+
let results;
|
|
7838
7847
|
if (this.gridType === TruDataGridTypes.DetailManyToMany)
|
|
7839
|
-
|
|
7848
|
+
results = this.dataContext.entityAccess().searchByRefArrayCacheOnly(this.config.resultConfig.entityManyToManyType, this.latestSetupQuery, [changeArgs.entity.Ref]);
|
|
7840
7849
|
else
|
|
7841
|
-
|
|
7842
|
-
if (
|
|
7850
|
+
results = this.dataContext.entityAccess().searchByRefArrayCacheOnly(this.config.resultConfig.entityType, this.latestSetupQuery, [changeArgs.entity.Ref]);
|
|
7851
|
+
if (results) {
|
|
7843
7852
|
let entityAlreadyInGrid = null;
|
|
7844
7853
|
this.api?.forEachNodeAfterFilter((rowNode) => {
|
|
7845
7854
|
if (rowNode.data.$entity.Ref === changeArgs.entity.Ref)
|
|
7846
7855
|
entityAlreadyInGrid = changeArgs.entity;
|
|
7847
7856
|
});
|
|
7848
7857
|
if (!entityAlreadyInGrid) {
|
|
7849
|
-
let enhancedEntity = this.enhanceRowDataForEntity(
|
|
7858
|
+
let enhancedEntity = this.enhanceRowDataForEntity(results[0]);
|
|
7850
7859
|
if (changeArgs.entity.Ref < 0) {
|
|
7851
|
-
this.applyRelationships(
|
|
7860
|
+
this.applyRelationships(results[0]);
|
|
7852
7861
|
this.rowData.push(enhancedEntity);
|
|
7853
7862
|
this.api.applyTransaction({ add: [enhancedEntity], addIndex: 0 });
|
|
7854
7863
|
}
|