mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
fix: support cellformatter in ListView table (#17590)
This commit is contained in:
parent
234b3cc739
commit
f45ae5443e
@ -575,7 +575,7 @@ function ListView({
|
||||
{/* Bulk action row checkbox */}
|
||||
<Body.CheckboxDataCell rowId={rowData.id} index={index} />
|
||||
{/* Field data */}
|
||||
{tableHeaders.map(({ key, name, ...rest }) => {
|
||||
{tableHeaders.map(({ key, name, cellFormatter, ...rest }) => {
|
||||
if (hasDraftAndPublish && name === 'publishedAt') {
|
||||
return (
|
||||
<Td key={key}>
|
||||
@ -622,6 +622,12 @@ function ListView({
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof cellFormatter === 'function') {
|
||||
return (
|
||||
<Td key={key}>{cellFormatter(rowData, { key, name, ...rest })}</Td>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Td key={key}>
|
||||
<CellContent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user