@trudb/tru-common-lib 0.2.322 → 0.2.324
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.
|
@@ -7818,7 +7818,16 @@ class TruDataGrid {
|
|
|
7818
7818
|
if (change.changeOperation === 'D') {
|
|
7819
7819
|
this.api.forEachNode((rowNode) => {
|
|
7820
7820
|
if (rowNode.data.$entity.Ref === change.tableRef) {
|
|
7821
|
-
rowNodesToRemove.push(rowNode
|
|
7821
|
+
rowNodesToRemove.push(rowNode);
|
|
7822
|
+
}
|
|
7823
|
+
});
|
|
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);
|
|
7822
7831
|
}
|
|
7823
7832
|
});
|
|
7824
7833
|
}
|
|
@@ -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
|
}
|