@trudb/tru-common-lib 0.2.274 → 0.2.276
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.
|
@@ -7785,16 +7785,8 @@ class TruDataGrid {
|
|
|
7785
7785
|
}));
|
|
7786
7786
|
}
|
|
7787
7787
|
this.subs.push(this.connectionHub.subscribe(this.dataContext, this.config.resultConfig.entityType, this.config.resultConfig.entityType.name, this.addEntity, this.getRowData, () => { return this.latestSetupQuery; }, this.config.resultConfig.expands, [], () => { return true; }).subscribe((dataChange) => {
|
|
7788
|
-
let rowNodesToAdd = [];
|
|
7789
7788
|
let rowNodesToRemove = [];
|
|
7790
7789
|
dataChange.dataChanges.forEach((change) => {
|
|
7791
|
-
if (change.changeOperation === 'I') {
|
|
7792
|
-
this.api.forEachNode((rowNode) => {
|
|
7793
|
-
if (rowNode.data.$entity.Ref === change.tableRef) {
|
|
7794
|
-
rowNodesToAdd.push(rowNode.data);
|
|
7795
|
-
}
|
|
7796
|
-
});
|
|
7797
|
-
}
|
|
7798
7790
|
if (change.changeOperation === 'D') {
|
|
7799
7791
|
this.api.forEachNode((rowNode) => {
|
|
7800
7792
|
if (rowNode.data.$entity.Ref === change.tableRef) {
|
|
@@ -7803,20 +7795,16 @@ class TruDataGrid {
|
|
|
7803
7795
|
});
|
|
7804
7796
|
}
|
|
7805
7797
|
});
|
|
7806
|
-
if (rowNodesToAdd.length) {
|
|
7807
|
-
setTimeout(() => {
|
|
7808
|
-
this.runSearch();
|
|
7809
|
-
}, 100);
|
|
7810
|
-
}
|
|
7811
7798
|
if (rowNodesToRemove.length) {
|
|
7812
7799
|
this.api.applyTransaction({ remove: rowNodesToRemove });
|
|
7813
7800
|
}
|
|
7801
|
+
this.api.refreshCells({ force: true });
|
|
7814
7802
|
}));
|
|
7815
7803
|
// Listen for entities added elsewhere in the app
|
|
7816
7804
|
// Merge this logic with addEntity() logic below
|
|
7817
7805
|
// Three ways to add: Directly via toolbar, signalR, or listen for entity added event
|
|
7818
7806
|
this.subs.push(this.dataContext.onEntityAdded().subscribe((changeArgs) => {
|
|
7819
|
-
if (!changeArgs.entity
|
|
7807
|
+
if (!changeArgs.entity)
|
|
7820
7808
|
return;
|
|
7821
7809
|
let entity;
|
|
7822
7810
|
if (this.gridType === TruDataGridTypes.DetailManyToMany)
|