From f6c90578a98182addf281b113b929b8c34748b5f Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 9 Sep 2021 08:27:17 +0200 Subject: [PATCH] #163 --- packages/web/src/datagrid/DataGridCore.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/web/src/datagrid/DataGridCore.svelte b/packages/web/src/datagrid/DataGridCore.svelte index f88a2ce0f..68f4df9be 100644 --- a/packages/web/src/datagrid/DataGridCore.svelte +++ b/packages/web/src/datagrid/DataGridCore.svelte @@ -165,7 +165,9 @@ return `Rows: ${allRowCount.toLocaleString()}`; } - function getCopiedValue(value) { + function extractCopiedValue(row, col) { + let value = row[col]; + if (value === undefined) value = _.get(row, col); if (value === null) return '(NULL)'; if (value === undefined) return '(NoField)'; if (_.isPlainObject(value) || _.isArray(value)) return JSON.stringify(value); @@ -339,7 +341,7 @@ if (!rowData) return ''; const line = colIndexes .map(col => realColumnUniqueNames[col]) - .map(col => getCopiedValue(rowData[col])) + .map(col => extractCopiedValue(rowData, col)) .join('\t'); return line; });