Skip to content

Commit 09f6c22

Browse files
fix data mapping dropdown value in table's column setting
1 parent 0d1e53e commit 09f6c22

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

client/packages/lowcoder/src/comps/comps/tableComp/column/tableColumnComp.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
ConstructorToView,
1818
deferAction,
1919
fromRecord,
20-
isDynamicSegment,
2120
multiChangeAction,
2221
withFunction,
2322
wrapChildAction,
@@ -199,21 +198,23 @@ const ColumnPropertyView = React.memo(({
199198
selectedColumn.getComp().children.compType.getView(),
200199
[selectedColumn]
201200
);
202-
201+
202+
const initialColumns = useMemo(() =>
203+
selectedColumn.getParams()?.initialColumns as OptionType[] || [],
204+
[selectedColumn]
205+
);
206+
203207
const columnValue = useMemo(() => {
204208
const column = selectedColumn.getComp().toJsonValue();
205209
if (column.comp?.hasOwnProperty('src')) {
206210
return (column.comp as any).src;
207211
} else if (column.comp?.hasOwnProperty('text')) {
208-
return isDynamicSegment((column.comp as any).text) ? '{{currentCell}}' : (column.comp as any).text;
212+
const value = (column.comp as any).text;
213+
const isDynamicValue = initialColumns.find((column) => column.value === value);
214+
return !isDynamicValue ? '{{currentCell}}' : value;
209215
}
210216
return '{{currentCell}}';
211-
}, [selectedColumn]);
212-
213-
const initialColumns = useMemo(() =>
214-
selectedColumn.getParams()?.initialColumns as OptionType[] || [],
215-
[selectedColumn]
216-
);
217+
}, [selectedColumn, initialColumns]);
217218

218219
const summaryColumns = comp.children.summaryColumns.getView();
219220

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy