@trudb/tru-common-lib 0.2.110 → 0.2.112
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.
|
@@ -5966,30 +5966,25 @@ class TruDataGridClipboard {
|
|
|
5966
5966
|
getCopiedRows = () => {
|
|
5967
5967
|
return this.rowData;
|
|
5968
5968
|
};
|
|
5969
|
-
paste = (config,
|
|
5969
|
+
paste = (config, selectedRows) => {
|
|
5970
5970
|
if (this.tableName !== config.tableName) {
|
|
5971
5971
|
this.uiNotification.error('Clipboard data does not match the current table name: ' + this.tableName + ' vs ' + config.tableName);
|
|
5972
5972
|
return;
|
|
5973
5973
|
}
|
|
5974
|
-
if (
|
|
5975
|
-
this.uiNotification.error('Clipboard data does not match the number of selected rows: ' + this.rowData.length + ' vs ' +
|
|
5974
|
+
if (selectedRows && selectedRows.length !== this.rowData.length) {
|
|
5975
|
+
this.uiNotification.error('Clipboard data does not match the number of selected rows: ' + this.rowData.length + ' vs ' + selectedRows.length);
|
|
5976
5976
|
return;
|
|
5977
5977
|
}
|
|
5978
5978
|
if (this.rowData.length) {
|
|
5979
|
-
this.rowData.forEach((
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
})
|
|
5988
|
-
.forEach((propertyName) => {
|
|
5989
|
-
if (typeof newEntity.setProperty !== 'undefined')
|
|
5990
|
-
newEntity.setProperty(propertyName, row.getProperty(propertyName));
|
|
5979
|
+
this.rowData.forEach((copiedRow, index) => {
|
|
5980
|
+
selectedRows.forEach((selectedRow) => {
|
|
5981
|
+
let properties = copiedRow.entityType.getPropertyNames();
|
|
5982
|
+
properties
|
|
5983
|
+
.forEach((propertyName) => {
|
|
5984
|
+
if (typeof selectedRow.$entty.setProperty !== 'undefined')
|
|
5985
|
+
selectedRow.$entity.setProperty(propertyName, copiedRow.$entity.getProperty(propertyName));
|
|
5986
|
+
});
|
|
5991
5987
|
});
|
|
5992
|
-
selectedRoows[index].setData(newEntity);
|
|
5993
5988
|
});
|
|
5994
5989
|
}
|
|
5995
5990
|
};
|