mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 07:39:16 +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 */}
|
{/* Bulk action row checkbox */}
|
||||||
<Body.CheckboxDataCell rowId={rowData.id} index={index} />
|
<Body.CheckboxDataCell rowId={rowData.id} index={index} />
|
||||||
{/* Field data */}
|
{/* Field data */}
|
||||||
{tableHeaders.map(({ key, name, ...rest }) => {
|
{tableHeaders.map(({ key, name, cellFormatter, ...rest }) => {
|
||||||
if (hasDraftAndPublish && name === 'publishedAt') {
|
if (hasDraftAndPublish && name === 'publishedAt') {
|
||||||
return (
|
return (
|
||||||
<Td key={key}>
|
<Td key={key}>
|
||||||
@ -622,6 +622,12 @@ function ListView({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof cellFormatter === 'function') {
|
||||||
|
return (
|
||||||
|
<Td key={key}>{cellFormatter(rowData, { key, name, ...rest })}</Td>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Td key={key}>
|
<Td key={key}>
|
||||||
<CellContent
|
<CellContent
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user