admin管理员组文章数量:1294325
I've created a table in antd, but i need that when the mouse is over the row a tooltip should show.
I'm doing this in the columns definition (rendering a tooltip for each cell), but in this way the tooltip hides between cells.
Example:
{
title: 'Fecha de Pedido',
dataIndex: 'fecha_pedido',
rowKey: 'fecha_pedido',
key: 'fecha_pedido',
sorter: (a, b) => moment(a.fecha_pedido).unix() - moment(b.fecha_pedido).unix(),
render:(text, record)=>(
<Tooltip title="Click para ver el detalle del pedido">
<span>{moment(record.fecha_pedido).format('DD-MM-YYYY HH:mm a')}</span>
</Tooltip>
),
},
Is there a way to show the tooltip in the entire row (instead of each cell)?
Thanks in advance, if you need any extra code snippet just please let me know.
I've created a table in antd, but i need that when the mouse is over the row a tooltip should show.
I'm doing this in the columns definition (rendering a tooltip for each cell), but in this way the tooltip hides between cells.
Example:
{
title: 'Fecha de Pedido',
dataIndex: 'fecha_pedido',
rowKey: 'fecha_pedido',
key: 'fecha_pedido',
sorter: (a, b) => moment(a.fecha_pedido).unix() - moment(b.fecha_pedido).unix(),
render:(text, record)=>(
<Tooltip title="Click para ver el detalle del pedido">
<span>{moment(record.fecha_pedido).format('DD-MM-YYYY HH:mm a')}</span>
</Tooltip>
),
},
Is there a way to show the tooltip in the entire row (instead of each cell)?
Thanks in advance, if you need any extra code snippet just please let me know.
Share Improve this question asked Apr 7, 2021 at 15:22 StepStep 1494 silver badges17 bronze badges1 Answer
Reset to default 9You should custom table row ponent by ponents.body.row
of Table
's props.
Example in CodeSandbox: https://codesandbox.io/s/jibenyongfa-antd4150-forked-3djn4?file=/index.js:1742-1752
本文标签: javascriptAntd Tooltip on table rowStack Overflow
版权声明:本文标题:javascript - Antd: Tooltip on table row - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741598395a2387548.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论